I created an app with three different Storyboards for each iOS device family. Now I don\'t know how to choose the right Storyboard when the app starts? I am checking the scr
I guess you want to open a view? If so this code will do the job:
var mainView: UIStoryboard!
mainView = UIStoryboard(name: "vcLogin", bundle: nil)
let viewcontroller : UIViewController = mainView.instantiateViewControllerWithIdentifier("iPhone5") as UIViewController
self.window!.rootViewController = viewcontroller
It will open the view controller with id: yourViewControllerId
You need to give your viewcontroller an identifier.
You do that by highlighting your view controller and then give it a identifier:
You then put your identifier in StoryBoard ID.
So for you it will be:
if screenHeight == 480 {
deviceFamily = "iPhoneOriginal"
// Load Storyboard with name: iPhone4
var mainView: UIStoryboard!
mainView = UIStoryboard(name: "vcLogin", bundle: nil)
let viewcontroller : UIViewController = mainView.instantiateViewControllerWithIdentifier("iPhone4") as UIViewController
self.window!.rootViewController = viewcontroller
}