FirstView→NavigationController→SecondView
のように遷移したい
同じストーリーボードでセグエは使わない方法
FirstView→NavigationController→SecondView
sample.swift
func test() {
let storyboard = UIStoryboard(name: "view1", bundle: NSBundle.mainBundle())
let naviView = storyboard.instantiateViewControllerWithIdentifier("Second") as! UINavigationController
let view = naviView.topViewController as! SecondView
view.hogehoge = "ほげほげ"
self.navigationController?.pushViewController(view, animated: true)
}
セグエを使う場合
FirstVCからpresent modallyでの遷移をつくる
その後、SecondVCにEmbed inでnavigation controllerを入れ込めばよい