LoginSignup
3
3

More than 5 years have passed since last update.

StoryboardにNavigationControllerを追加して起動時の表示画面(Initial View Controller)にする

Posted at

Single View Applicationで作り始めたけれど

SingleViewApplication.png

やっぱりNavigationControllerを使いたくなることってありますよね。
そんなとき「あれ?どうするんだっけ??」と時間をムダにしないためのメモです。

StoryBoardのObject LibraryからNavigation Controllerを選択して

NavigationViewControllerSelect.png

貼り付けます。

AddNavigationController.png

既存のView Controllerを使いたいので、右側のViewControllerは削除します。
Root View Controllerというのを選択してCtrl + delete

DeleteViewController.png

起動時に表示したいので、追加したNavigation Controllerを選択して下記のIs Initial View Controllerにチェックします。

InitialViewController.png

そして、追加したNavigationControllerから既存のViewControllerにroot view controllerのSegueを作ります。

SequeToRootViewController.png

これで、NavigationControllerが追加されました。

3
3
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
3
3