Statt LoginController präsentieren Sie haben die entsprechenden Viewcontroller als RootViewController zum Fenster in AppDelegate mich als folllows zu setzen:
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()
Diese Standardansicht von der Anzeige vor der Vorlage LoginController verhindern.
Oder
Im Storyboard # 1 erstellen DummyViewController (UIViewController) und macht es als InitialViewController und ein Hintergrundbild gesetzt (Ihr Splashscreen Bild) zu DummyViewController .In viewDidLoad Anmeldeinformationen zu überprüfen, wenn Sie Wert haben
let storyboard = UIStoryboard(name: "storyboard #1", bundle: nil)
let controller = storyboard.instantiateViewControllerWithIdentifier("default view ") as UIViewController
presentViewController(controller, animated: true, completion: nil)
wenn keine Anmeldeinformationen mit Ihrem gegebenen Code gehen
let storyboard = UIStoryboard(name: "Authentication", bundle: nil)
let controller = storyboard.instantiateViewControllerWithIdentifier("LoginController") as UIViewController
presentViewController(controller, animated: true, completion: nil)
dies verhindert auch Flimmern, aber es ist kein guter Weg zu tun.Ich schlage vor Erste Methode Einstellung rootviewcontroller.Dies kann Ihnen helfen.Ergeben Sie es ein Versuch.