Skip to content

Instantly share code, notes, and snippets.

@giln
Created May 6, 2019 13:53
Show Gist options
  • Save giln/0ee66f2e5f36e388e30dc59fe6ef2601 to your computer and use it in GitHub Desktop.
Save giln/0ee66f2e5f36e388e30dc59fe6ef2601 to your computer and use it in GitHub Desktop.
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_: UIApplication, didFinishLaunchingWithOptions _: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
window = UIWindow(frame: UIScreen.main.bounds)
window?.backgroundColor = UIColor.white
window?.makeKeyAndVisible()
let movieListCoordinator = MovieListCoordinator()
movieListCoordinator.tabBarItem = UITabBarItem(tabBarSystemItem: .featured, tag: 0)
let searchController = MovieSearchViewController()
searchController.tabBarItem = UITabBarItem(tabBarSystemItem: .search, tag: 0)
let navBar = UINavigationController(rootViewController: searchController)
let tabbarController = UITabBarController()
tabbarController.viewControllers = [movieListCoordinator, navBar]
window?.rootViewController = tabbarController
return true
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment