![見出し画像](https://assets.st-note.com/production/uploads/images/26049421/rectangle_large_type_2_c279e4ab5c3ebfe3246628d7a5690cc7.jpg?width=800)
【Swift】モーダル遷移でNavigationBarを表示する
こんにちは!シオンです!
モーダル遷移にしたいけど、NavigationControllerのバーも出したいなーと思っているとすごくあっさりと解決できたのでメモ。
以下コードです。
//遷移先のビュー
let nextView = self.storyboard?.instantiateViewController(identifier: "nextView")
let nav = UINavigationController(rootViewController: nextView!)
present(nav,animated: true,completion: nil)
これだけです。
この記事が気に入ったらサポートをしてみませんか?