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 screen height to recognize the different devices:
func application(application: UIApplication!, didFinishLaunchingWithOptions launchOptions: NSDictionary!) -> Bool {
// Check Device Family
var bounds: CGRect = UIScreen.mainScreen().bounds
var screenHeight: NSNumber = bounds.size.height
var deviceFamily: String
if screenHeight == 480 {
deviceFamily = "iPhoneOriginal"
// Load Storyboard with name: iPhone4
} else if screenHeight == 568 {
deviceFamily = "iPhone5Higher"
// Load Storyboard with name: iPhone5
} else {
deviceFamily = "iPad"
// Load Storyboard with name: iPad
}
return true
}
Can somebody give me a working solution in Swift? I only found solutions for ObjC.
Thanks.