Created
August 13, 2015 02:55
-
-
Save satomixx/48a1925f18be0770067a to your computer and use it in GitHub Desktop.
[Swift] Storyboardを使わずに画面遷移をすると、遷移先が黒画面になるときやstoryboard doesn't contain a view controller with identifier 'って言われるとき。 ref: http://qiita.com/tsumekoara/items/c8cb6f815e6dc0b6beba
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let storyboard = UIStoryboard(name: "STORYBOARD_NAME", bundle: nil) | |
let nextVC = storyboard.instantiateViewControllerWithIdentifier("STORYBOARD_ID_OF_VC_CLASS") as! UIViewController | |
navigationController?.pushViewController(nextVC, animated: true) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
storyboard doesn't contain a view controller with identifier 'foo'' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// set next VC | |
let nextVC: UIViewController = FooVC() | |
// set animation | |
nextVC.modalTransitionStyle = UIModalTransitionStyle.PartialCurl | |
// transition | |
self.presentViewController(nextVC, animated: true, completion: nil) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment