我正在尝试将我的onBoarding屏幕设置为应用委托中的rootViewController,但由于某种原因崩溃,我已经尝试追找原因并找不到任何原因。此行崩溃int
。
let intialViewcontroller = storyboard.instantiateViewController(withIdentifier: "onBoarding")
记录
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
UIApplication.shared.statusBarStyle = .lightContent
if let barFont = UIFont(name: "AvenirNext-DemiBold", size: 24.0) {
UINavigationBar.appearance().titleTextAttributes =
[NSForegroundColorAttributeName:UIColor.white, NSFontAttributeName:barFont]
}
FBSDKApplicationDelegate.sharedInstance().application(application, didFinishLaunchingWithOptions: launchOptions)
FirebaseApp.configure()
window = UIWindow(frame: UIScreen.main.bounds)
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let intialViewcontroller = storyboard.instantiateViewController(withIdentifier: "onBoarding")
window?.rootViewController = intialViewcontroller
window?.makeKeyAndVisible()
return true
}