Loading a Welcome Screen (Splash Screen) before TabBarController

后端 未结 5 1441
不知归路
不知归路 2020-12-08 09:11

In my TabBar based iPhone application, I would like to display a full screen welcome page (with some logs) before the actual application loads, How can I load a UIView from

5条回答
  •  死守一世寂寞
    2020-12-08 09:17

    I add a subView to the main window in the appDelegate:

    LoginViewController *loginController = [[LoginViewController alloc] initWithNibName:@"LoginViewController"
                                                                                 bundle: nil];
    [window addSubview: [loginController view]];
    

    Then in the LoginViewController, when I'm ready to dismiss the View (to show YOUR tabController say) I do:

    UIView *currentView = self.view;
    UIView *theWindow = [currentView superview];
    
    [currentView removeFromSuperview];
    
    CATransition *animation = [CATransition animation];
    [animation setDuration:0.5];
    [animation setType:kCATransitionPush];
    [animation setSubtype:kCATransitionFromBottom];
    [animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
    
    [[theWindow layer] addAnimation:animation forKey:@"SwitchToView1"];
    

提交回复
热议问题