ipad iPhoenのプログラムによる切り分けの良い記事がなかったので、忘備録
//ストーリーボードの型宣言 var storyboard : UIStoryboard? //ここにipad iphone切り分けを書く func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { var storyboard: UIStoryboard = UIStoryboard(name: storyboardName(), bundle: nil) self.window = UIWindow(frame: UIScreen.main.bounds) self.window?.rootViewController = storyboard.instantiateInitialViewController() //表示の更新 uiwindowは更新しないといけない self.window?.makeKeyAndVisible() return true } //画面切り分けfunc hideyasu 2017.10.1 func storyboardName()->String{ if ((UIDevice.current).userInterfaceIdiom) == UIUserInterfaceIdiom.phone { //iPhoneのストーリーボードを返す return "iPhone" }else{ return "Main" } } //初回起動時の画面の向き func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask { if ((UIDevice.current).userInterfaceIdiom) == UIUserInterfaceIdiom.phone { //iPhoneのストーリーボードを返す return [.portrait , .portraitUpsideDown] }else{ //ipadのストーリーボードを返す return .landscape } }