Storyboardを3つに分け、それぞれを順番に画面遷移(A.storyboard -> B.storyboard -> etc..)するシステムを作りました。
途中のstoryboard内で(2つ目)rootViewControllerを変更する必要が生じたので、下記のコードにより変更しました。
swift
1 class SecondViewCont... 2 . 3 . 4 override func viewDidAppear(_ animated: Bool) { 5 super.viewDidAppear(animated) 6 7 if self.isBeingPresented || self.isMovingToParent { 8 self.change_RootViewController() 9 } 10 } 11 12 . 13 . 14 15 /// rootViewControllerをsecondViewControllerに変更する 16 func change_RootViewController(){ 17 let appDelegate = UIApplication.shared.delegate as! AppDelegate 18 appDelegate.window?.rootViewController = self 19 } 20
しかし、この段階でrootViewControllerを変更し、3つ目のstoryboardがNavigationControllerだった場合、NavigationController内で画面遷移をした際にヘッダーがスライドフェードしながら変化するはずが、何も変化しません。
これを解決する方法を教えてください。
詳細説明のため、画像を用意しましたので合わせて確認お願いします。
あなたの回答
tips
プレビュー