【Swift】モーダル遷移でNavigationBarを表示する
こんにちは!シオンです!
モーダル遷移にしたいけど、NavigationControllerのバーも出したいなーと思っているとすごくあっさりと解決できたのでメモ。
以下コードです。
//遷移先のビュー
let nextView = self.storyboard?.instantiateViewController(identifier: "nextView")
let nav = UINavigationController(rootViewController: nextView!)
present(nav,animated: true,completion: nil)
これだけです。