iOSアプリで画面遷移を行う方法はたくさんあります。storyboardでやったり、コードでやったり。
例えば
// set next VC
let nextVC: UIViewController = FooVC()
// set animation
nextVC.modalTransitionStyle = UIModalTransitionStyle.PartialCurl
// transition
self.presentViewController(nextVC, animated: true, completion: nil)
navigationありのとき
let nextVC = FooVC() as UIViewController
nextVC.modalTransitionStyle = UIModalTransitionStyle.PartialCurl
navigationController?.pushViewController(nextVC, animated: true)
遷移先画面が黒くなるとき
Storyboardでのレイアウトが反映されず、真っ黒な画面が出てしまうのは、コードでの遷移の際はStoryboardを明示しないと、コードでレイアウトを作っているものとして扱われる(いちいちstoryboardをよまない)っぽい。。。
なので、以下の様にしてやるといいです。
storyboardでレイアウトは作成していて、遷移はコードでやろうとしたときとか、Storyboardをまたがる遷移のとき。
let storyboard = UIStoryboard(name: "STORYBOARD_NAME", bundle: nil)
let nextVC = storyboard.instantiateViewControllerWithIdentifier("STORYBOARD_ID_OF_VC_CLASS") as! UIViewController
navigationController?.pushViewController(nextVC, animated: true)
エラー storyboard doesn't contain a view controller with identifier ''
ここまでして、
storyboard doesn't contain a view controller with identifier 'foo''
とかエラーがでたりしたら、
それはstoryboard idの設定をミスっているのかもしれないです。
特に use storyboard idにチェックを入れていないことがあったりします。