presentViewController in AppDelegate with delay in iOS8

前端 未结 5 747
长发绾君心
长发绾君心 2021-02-02 10:02

So I had a full working solution in iOS7 that displays a LoginViewController via presentViewController in the AppDelegate\'s didFinishLaunching.

Basically I am doing so

5条回答
  •  抹茶落季
    2021-02-02 10:33

    You can set the window to an instance of a temporary controller.

    self.window.backgroundColor = [UIColor whiteColor]; //do some styling etc.
    self.window.rootViewController =  [LoginViewController new]; 
    [self.window makeKeyAndVisible];
    

    From the set controller (LoginViewController) you can push your real login controller with the desired transition. Once the login sequence is over you can make a transition from the login controller to the default application root view controller.

    [UIView transitionWithView:[AppGlobal sharedApp].applicationWindow
      duration:0.75
      options:UIViewAnimationOptionTransitionFlipFromLeft
      animations:^{
       [AppGlobal sharedApp].applicationWindow.rootViewController = [AppRootViewController new];
      } completion:nil];
    

提交回复
热议问题