import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { let navigationController = UINavigationController(rootViewController: Controller()) self.launch(rootViewController: navigationController) return true } func launch(rootViewController: UIViewController) { let frame = UIScreen.main.bounds self.window = UIWindow(frame: frame) self.window!.rootViewController = rootViewController self.window!.makeKeyAndVisible() } }