-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainTabBarViewController.swift
More file actions
35 lines (30 loc) · 1.02 KB
/
MainTabBarViewController.swift
File metadata and controls
35 lines (30 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
//
// MainTabBarViewController.swift
// Funbox
//
// Created by Антон Кочетков on 28.11.2021.
//
import UIKit
class MainTabBarViewController: UITabBarController {
override func viewDidLoad() {
super.viewDidLoad()
setupTabBar()
delegate = self
}
private func setupTabBar() {
tabBar.tintColor = .black
tabBar.barTintColor = .systemGray4
tabBar.unselectedItemTintColor = .lightGray
tabBar.backgroundColor = .systemGray4
}
}
extension MainTabBarViewController: UITabBarControllerDelegate {
func tabBarController(_ tabBarController: UITabBarController, didSelect viewController: UIViewController) {
if let storePage = viewController as? StorePageViewController {
storePage.updateContent()
} else if let navContr = viewController as? UINavigationController {
guard let backEnd = navContr.viewControllers.first as? BackEndViewController else { return }
backEnd.updateContent()
}
}
}