LoginSignup
1
1

More than 5 years have passed since last update.

[Swift] コードでの画面遷移で NavigationControllerを使ってもスライドアニメーションをさせない方法

Posted at

あたりまでだけど、Segueとこんがらがったりしてなんか忘れていたので、メモ。

スライドアニメーションが出るコード

var storyboard: UIStoryboard = UIStoryboard(name: "storyboardName", bundle: nil)
var nextVC: UIViewController = storyboard.instantiateInitialViewController() as! UIViewController
self.navigationController?.pushViewController(nextVC, animated: true)

させない方法

var storyboard: UIStoryboard = UIStoryboard(name: "storyboardName", bundle: nil)
var nextVC: UIViewController = storyboard.instantiateInitialViewController() as! UIViewController
self.navigationController?.pushViewController(nextVC, animated: false)

animatedをfalseにするのです。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1