0

ログイン画面がナビゲーションコントローラに組み込まれています。 ユーザーが正しい資格情報でログインすると、ユーザーをUITabBarControllerにプッシュします。私はこれを行うことができますが、タブをクリックして別のビューに移動すると、個々のビューにはナビゲーションボタンが表示されません。アプリデリゲートでUITabBarControllerへのログイン画面にナビゲーションリンクがありません

、ログインが成功したら、私は、次のコードを使用しています:

let myStoryBoard:UIStoryboard = UIStoryboard(name:"Main", bundle:nil) 

let protectedPage = myStoryBoard.instantiateViewController(withIdentifier: "MainView") as! UITabBarController 

let protectedPageNav = UINavigationController(rootViewController: protectedPage) 

self.window?.rootViewController = protectedPageNav 

どのように私はこの問題を解決することができますすることは?アップルのドキュメントを1として

story board

答えて

0

あなたが好ましくUIWindowのルートとしてUITabBarControllerを割り当てる必要があります述べています。

コードを変更してください。

let myStoryBoard:UIStoryboard = UIStoryboard(name:"Main", bundle:nil) 

let protectedPage = myStoryBoard.instantiateViewController(withIdentifier: "MainView") as! UITabBarController 


//change UIViewAnimationOptions enum value and you will get some animation 
UIView.transition(with: self.window!, duration: 0.34, options: UIViewAnimationOptions.transitionCrossDissolve, animations: { 
      self.window?.rootViewController = protectedPage 
     }, completion: {competion in 

     }) 
+0

驚くばかりです。ありがとう、トン! – Dev

関連する問題