NavigationControllerのsetViewControllersを使用して
FirstViewControllerからRootViewにpopしてからすぐにSecondControllerに遷移をしようと思っています。
swift
1//pop先のRootViewController 2let beforeStoryboard: UIStoryboard = UIStoryboard(name: "RootViewController",bundle: nil) 3let beforeView = beforeStoryboard.instantiateViewController(withIdentifier: "RootViewController")as! RootViewController 4//遷移先のSecondViewController 5let nextStoryboard: UIStoryboard = UIStoryboard(name: "SecondViewController", bundle: nil) 6let nextView = nextStoryboard.instantiateViewController(withIdentifier: "SecondViewController") as! SecondViewController 7//値の引き渡し 8nextView.secondProPerty = firstProperty 9//setViewControllers 10self.navigationController?.setViewControllers([beforeView,nextView], animated: true)
これでSecondViewController→RootViewControllerに遷移できる事は確認できましたが、
遷移元と遷移先が水平方向に裏返しになるような遷移アニメーションを指定したい場合には
どんなコードを追加すると良いのでしょうか?
分かりづらいかもしれませんが、
是非ともご教示の程、よろしくお願い致します。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。