あなたはfolllowsとしてAppdelegate自体に窓にrootviewcontrollerとしてそれぞれのViewControllerを設定する必要があります。
self.window = UIWindow(frame: UIScreen.mainScreen().bounds)
//Check for credentials,if value available make LoginStatus as true
if LoginStatus == true{
//Change Storyboard name "Main" to your "storyboard #1" name.
let mainStoryboard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
//Change Viecontroller name "My_Offer" to your "DefaultViewController name" name.
let vc = mainStoryboard.instantiateViewControllerWithIdentifier("My_Offer") as UIViewController
let navigationController = UINavigationController(rootViewController: vc)
self.window!.rootViewController = navigationController
}else{
let mainStoryboard: UIStoryboard = UIStoryboard(name: "Authentication", bundle: nil)
let vc = mainStoryboard.instantiateViewControllerWithIdentifier("LoginController") as UIViewController
let navigationController = UINavigationController(rootViewController: vc)
self.window!.rootViewController = navigationController
}
self.window!.makeKeyAndVisible()
これはLoginControllerを提示する前に、デフォルトのビューを表示するから防ぐことができます。ストーリーボード#で
さも
1はDummyViewController(のUIViewController)を作成し、InitialViewControllerとしてそれを作るとあなた場合は、資格情報のDummyViewController .INのviewDidLoadチェックに背景画像(あなたのスプラッシュ画面イメージ)を設定します持っている価値
let storyboard = UIStoryboard(name: "storyboard #1", bundle: nil)
let controller = storyboard.instantiateViewControllerWithIdentifier("default view ") as UIViewController
presentViewController(controller, animated: true, completion: nil)
何の資格情報があなたの特定のコードで行くない場合
let storyboard = UIStoryboard(name: "Authentication", bundle: nil)
let controller = storyboard.instantiateViewControllerWithIdentifier("LoginController") as UIViewController
presentViewController(controller, animated: true, completion: nil)
これもちらつきを防ぎますが、それは良い方法ではありません。私は最初の方法 rootviewcontrollerを設定することをお勧めします。これはあなたを助けるかもしれません。