Q:

Multiple storyboards in Swift

I have an app which has 4 storyboards, each for a different device (iphone4, 5, 6, 6+).  I have tried to use auto constraints but since my app is complicated, I wasn't able to figure it out.   I have heard that if you have multiple storyboards there should be a way of specifying which storyboard to use in the app delegate.  How do I go about specifying the proper storyboard for the proper device in the app delegate?  I currently have four storyboards, named:
iphone4s.storyboard 
iphone5.storyboard 
iphone6.storyboard 
iphone6plus.storyboard
Thank you.

A:

According to me these days we make use of autoLayout which knows how to layout its view for depending on screen size and constraints 
As you asked you can override the storyboard from AppDelegate in applicationdidFinishLaunchingWithOptions method
    let storyBoard : UIStoryboard = UIStoryboard(name: "iphone4s", bundle: nil)
    //you can check your device and override the storyboard name
    let initialViewController: UIViewController =  storyBoard.instantiateInitialViewController()!
    self.window?.rootViewController? = initialViewController

A:

Implement a function that retrieves the storyboard when it's name is specified.
func getStoryBoard(name : String)-> UIStoryboard
{
    var storyBoard = UIStoryboard(name: name, bundle: nil);
    return storyBoard;
}

Change the app delegate method like:
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool
{
    var storyBoard = getStoryBoard("Main") // Change the storyboard name based on the device, you may need to write a condition here for that
    var initialViewController: UIViewController = storyBoard.instantiateInitialViewController() as! UIViewController
    self.window?.rootViewController = initialViewController
    self.window?.makeKeyAndVisible()
    // Override point for customization after application launch.
    return true
}

