I'm trying to make a wrapper that'll add additional functionality if the device is an iPad, if it's not the application should continue though the storyboard without the wrapper.
The wrapper is a View Controller with two container views. The large one is for the main functionality and the small one is for the additional iPad functionality.
The container's connection is dumped right where the normal storyboard entry point would be.
So is there a way to have multiple entry points based on what device is being used? That way one can have the wrapper and the other won't.
Here's whats in AppDelegate
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch.
self.window = UIWindow(frame: UIScreen.mainScreen().bounds)
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let iPadEntryViewController = storyboard.instantiateViewControllerWithIdentifier("iPadWrapperView") as! UIViewController
let iPhoneEntryViewController = storyboard.instantiateViewControllerWithIdentifier("iPhoneEntryPointView")as! UIViewController
if (/* SOME ACTION */ false) {
self.window?.rootViewController = iPadEntryViewController
self.window?.makeKeyAndVisible()
}
else {
self.window?.rootViewController = iPhoneEntryViewController
self.window?.makeKeyAndVisible()
}
return true
}
So what would go in the if statement to check if the device is an iPad?