Commit 24d2521d by M. Porooshani

Updated the Example app to support hidesBottomBarWhenPushed

parent f099182d
...@@ -43,7 +43,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -43,7 +43,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
menuController.edgesForExtendedLayout = .None menuController.edgesForExtendedLayout = .None
let bottomNavigationController: BottomNavigationController = BottomNavigationController() let bottomNavigationController: BottomNavigationController = BottomNavigationController()
bottomNavigationController.viewControllers = [menuController, VideoViewController(), PhotoViewController()] bottomNavigationController.viewControllers = [/*menuController*/navigationController, VideoViewController(), PhotoViewController()]
bottomNavigationController.selectedIndex = 0 bottomNavigationController.selectedIndex = 0
bottomNavigationController.tabBar.tintColor = MaterialColor.white bottomNavigationController.tabBar.tintColor = MaterialColor.white
bottomNavigationController.tabBar.backgroundColor = MaterialColor.grey.darken4 bottomNavigationController.tabBar.backgroundColor = MaterialColor.grey.darken4
......
...@@ -49,7 +49,6 @@ class AppMenuController: MenuController { ...@@ -49,7 +49,6 @@ class AppMenuController: MenuController {
override init(rootViewController: UIViewController) { override init(rootViewController: UIViewController) {
super.init(rootViewController: rootViewController) super.init(rootViewController: rootViewController)
prepareTabBarItem()
} }
override func viewDidLoad() { override func viewDidLoad() {
...@@ -144,12 +143,6 @@ class AppMenuController: MenuController { ...@@ -144,12 +143,6 @@ class AppMenuController: MenuController {
view.layout.alignFromBottomRight(menuView, bottom: menuViewInset, right: menuViewInset) view.layout.alignFromBottomRight(menuView, bottom: menuViewInset, right: menuViewInset)
} }
/// Prepare tabBarItem.
private func prepareTabBarItem() {
tabBarItem.image = MaterialIcon.cm.photoLibrary
tabBarItem.setTitleColor(MaterialColor.grey.base, forState: .Normal)
tabBarItem.setTitleColor(MaterialColor.white, forState: .Selected)
}
} }
/// MenuViewDelegate. /// MenuViewDelegate.
......
...@@ -35,6 +35,7 @@ class AppNavigationController: NavigationController { ...@@ -35,6 +35,7 @@ class AppNavigationController: NavigationController {
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
prepareNavigationBar() prepareNavigationBar()
prepareTabBarItem()
} }
/// Prepares the navigationBar /// Prepares the navigationBar
...@@ -42,4 +43,12 @@ class AppNavigationController: NavigationController { ...@@ -42,4 +43,12 @@ class AppNavigationController: NavigationController {
navigationBar.tintColor = MaterialColor.white navigationBar.tintColor = MaterialColor.white
navigationBar.backgroundColor = MaterialColor.blue.base navigationBar.backgroundColor = MaterialColor.blue.base
} }
/// Prepare tabBarItem.
private func prepareTabBarItem() {
tabBarItem.image = MaterialIcon.cm.photoLibrary
tabBarItem.setTitleColor(MaterialColor.grey.base, forState: .Normal)
tabBarItem.setTitleColor(MaterialColor.white, forState: .Selected)
}
} }
...@@ -57,6 +57,7 @@ class ItemViewController: UIViewController { ...@@ -57,6 +57,7 @@ class ItemViewController: UIViewController {
convenience init(dataSource: MaterialDataSourceItem) { convenience init(dataSource: MaterialDataSourceItem) {
self.init(nibName: nil, bundle: nil) self.init(nibName: nil, bundle: nil)
self.dataSource = dataSource self.dataSource = dataSource
hidesBottomBarWhenPushed = true
} }
required init?(coder aDecoder: NSCoder) { required init?(coder aDecoder: NSCoder) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment