-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor tabbar into navigation folder from scene delegate
- Loading branch information
grenos
committed
Apr 10, 2020
1 parent
996511f
commit 0311ec9
Showing
4 changed files
with
50 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+12.9 KB
(120%)
...odeproj/project.xcworkspace/xcuserdata/vasilis.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// | ||
// GFTabBarController.swift | ||
// GHFollowers | ||
// | ||
// Created by Vasileios Gkreen on 10/04/2020. | ||
// Copyright © 2020 Vasileios Gkreen. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
|
||
class GFTabBarController: UITabBarController { | ||
|
||
override func viewDidLoad() { | ||
super.viewDidLoad() | ||
|
||
UITabBar.appearance().tintColor = .systemGreen | ||
// put NAvigation Controllers inside the tab bar controller | ||
viewControllers = [createSearchNC(), createFavoritesNC()] | ||
} | ||
|
||
func createSearchNC() -> UINavigationController { | ||
let searchVC = SearchVC() | ||
searchVC.title = "Search" | ||
searchVC.tabBarItem = UITabBarItem(tabBarSystemItem: .search, tag: 0) | ||
|
||
return UINavigationController(rootViewController: searchVC) | ||
} | ||
|
||
func createFavoritesNC() -> UINavigationController { | ||
let favoritesVC = FavoriteListVC() | ||
favoritesVC.title = "Favorites" | ||
favoritesVC.tabBarItem = UITabBarItem(tabBarSystemItem: .favorites, tag: 1) | ||
|
||
return UINavigationController(rootViewController: favoritesVC) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters