private let profileViewController: ProfileViewController = {
let vc = ProfileViewController()
vc.tabBarItem.title = "Profile"
return vc
}()
private let inviteFriendsViewController: InviteFriendsViewController = {
let vc = InviteFriendsViewController()
vc.tabBarItem.title = "Invite friend"
return vc
}()
private let invitationsViewController: InvitationsViewController = {
let vc = InvitationsViewController()
vc.tabBarItem.title = "Invitations"
return vc
}()
private let chatsViewController: ChatsViewController = {
let vc = ChatsViewController()
vc.tabBarItem.title = "Chats"
return vc
}()
private let editGalleryViewController: EditGalleryViewController = {
let vc = EditGalleryViewController()
vc.tabBarItem.title = "Gallery"
return vc
}()
private let editFieldNavController: EditGroupNavController = {
let vc = EditGroupNavController()
vc.tabBarItem.title = "Edit field"
return vc
}()
private let editHiddenFieldNavController: EditGroupNavController = {
let vc = EditGroupNavController()
vc.tabBarItem.title = "Hidden field"
return vc
}()
private let searchMemberViewController: SearchMemberViewController = {
let vc = SearchMemberViewController()
vc.tabBarItem.title = "Member"
return vc
}()
private let supportViewController: SupportViewController = {
let vc = SupportViewController()
vc.tabBarItem.title = "Support"
return vc
}()
private let moreController: UIViewController = {
let vc = UIViewController()
vc.tabBarItem.title = "More"
return vc
}()
var networkManager: NetworkManagment?
override func viewDidLoad() {
super.viewDidLoad()
let vc1 = EditGroupNavController()
let vc2 = EditGalleryViewController()
let vc3 = SearchMemberViewController()
let vc4 = SupportViewController()
let vc5 = InviteFriendsViewController()
let vc6 = ChatsViewController()
setupNetworkManager()
setupNavigationBar()
// viewControllers = [editFieldNavController, editGalleryViewController, searchMemberViewController, supportViewController, moreController, inviteFriendsViewController]
viewControllers = [vc1, vc2, vc3, vc4, vc5, vc6]
print(viewControllers)
viewControllers?.append(vc5)
print(viewControllers)
viewControllers?.append(vc6)
print(viewControllers)
}
private func setupNetworkManager() {
let networking = NetworkService()
networkManager = NetworkManager(networking: networking)
}
private func setupNavigationBar() {
self.navigationController?.setNavigationBarHidden(true, animated: false)
self.navigationItem.setHidesBackButton(true, animated: false)
}
override func tabBar(_ tabBar: UITabBar, didSelect item: UITabBarItem) {
print(viewControllers)
}
}
так вот код
Обсуждают сегодня