現在この様な画面構成になっていて、起動後に一番右の濃い青い画面(first)へ遷移したいのですが
現在こコードでは
Could not cast value of type 'UITabBarController'to 'UINavigationController'
となってしまいす、navigationcontrollerの前にtabviewcontrollerがあるのでこの様なエラーが出てしまうと思うのですがどの様に書き換えれば良いでしょか?
swift
1 func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 2 3 let storyboad = UIStoryboard(name: "Main", bundle: nil) 4 let first : UIViewController = storyboad.instantiateViewController(withIdentifier: "first") as UIViewController 5 let navigationController: UINavigationController = self.window!.rootViewController as! UINavigationController; 6 navigationController.pushViewController(first, animated: false) 7} 8
回答3件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。