This repository has been archived on 2025-11-05. You can view files and clone it, but cannot push or open issues or pull requests.
ios_app/Shared/Views/Tab/MainView.swift
2025-07-25 00:20:25 +03:00

47 lines
1.1 KiB
Swift
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//
// MainView.swift
// VolnahubApp
//
// Created by cheykrym on 09/06/2025.
//
import SwiftUI
struct MainView: View {
@ObservedObject var viewModel: LoginViewModel
@State private var selectedTab: Int = 0
var body: some View {
VStack(spacing: 0) {
ZStack {
switch selectedTab {
case 0:
HomeTab()
case 1:
SearchTab()
case 2:
ChatsTab()
case 3:
ProfileTab(viewModel: viewModel)
default:
HomeTab()
}
}
.frame(maxWidth: .infinity, maxHeight: .infinity)
CustomTabBar(selectedTab: $selectedTab) {
// Действие для кнопки "Создать"
print("Create button tapped")
}
}
.ignoresSafeArea(edges: .bottom)
}
}
struct MainView_Previews: PreviewProvider {
static var previews: some View {
let mockViewModel = LoginViewModel()
MainView(viewModel: mockViewModel)
}
}