Single View Applicationで作り始めたけれど
![SingleViewApplication.png](https://qiita-user-contents.imgix.net/https%3A%2F%2Fqiita-image-store.s3.amazonaws.com%2F0%2F2885%2F171cec7e-006e-761e-848f-10439aaeaa7d.png?ixlib=rb-4.0.0&auto=format&gif-q=60&q=75&s=c615a2612bfb61305c5d54aa279def8d)
やっぱりNavigationControllerを使いたくなることってありますよね。
そんなとき「あれ?どうするんだっけ??」と時間をムダにしないためのメモです。
StoryBoardのObject LibraryからNavigation Controllerを選択して
![NavigationViewControllerSelect.png](https://qiita-user-contents.imgix.net/https%3A%2F%2Fqiita-image-store.s3.amazonaws.com%2F0%2F2885%2Ffd481d43-2273-6d3a-fe31-41d36b75327c.png?ixlib=rb-4.0.0&auto=format&gif-q=60&q=75&s=e23b6b6e3e53352bc53fd31e0459493e)
貼り付けます。
![AddNavigationController.png](https://qiita-user-contents.imgix.net/https%3A%2F%2Fqiita-image-store.s3.amazonaws.com%2F0%2F2885%2Fc7299745-3ceb-0ed7-944f-87898fa48eb7.png?ixlib=rb-4.0.0&auto=format&gif-q=60&q=75&s=a55d84346d36bac67772c8d772c001c7)
既存のView Controllerを使いたいので、右側のViewControllerは削除します。
Root View Controllerというのを選択してCtrl + delete
![DeleteViewController.png](https://qiita-user-contents.imgix.net/https%3A%2F%2Fqiita-image-store.s3.amazonaws.com%2F0%2F2885%2F74bcdb03-2760-ef8a-cf74-78447e313ff9.png?ixlib=rb-4.0.0&auto=format&gif-q=60&q=75&s=44da957720f2dba2f5ad8ebd8825ccfc)
起動時に表示したいので、追加したNavigation Controllerを選択して下記のIs Initial View Controllerにチェックします。
![InitialViewController.png](https://qiita-user-contents.imgix.net/https%3A%2F%2Fqiita-image-store.s3.amazonaws.com%2F0%2F2885%2F8c0b7e07-8b74-1573-fd00-2ada18c917bb.png?ixlib=rb-4.0.0&auto=format&gif-q=60&q=75&s=68c6d901014cb3b4f5f7f6569511b820)
そして、追加したNavigationControllerから既存のViewControllerにroot view controllerのSegueを作ります。
![SequeToRootViewController.png](https://qiita-user-contents.imgix.net/https%3A%2F%2Fqiita-image-store.s3.amazonaws.com%2F0%2F2885%2F78a0000c-17f4-794a-f5e5-adb502be4ada.png?ixlib=rb-4.0.0&auto=format&gif-q=60&q=75&s=0ee53847a980abbc95e7688b9eb3974e)
これで、NavigationControllerが追加されました。