#import "XZMCoreNewFeatureVC.h"
#import "CALayer+Transition.h"
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
UIWindow *window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
self.window = window;
[UIApplication sharedApplication].statusBarHidden = YES;
if(![[NSUserDefaults standardUserDefaults] boolForKey:@"firstStart"]){
[self showNewFeatureViewWithCanShow:YES];
}else{
[self showNewFeatureViewWithCanShow:NO];
NSLog(@"非第一次启动");
}
[window makeKeyAndVisible];
return YES;
}
-(void)showNewFeatureViewWithCanShow:(BOOL)canShow{
if(canShow){
self.window.rootViewController = [XZMCoreNewFeatureVC newFeatureVCWithPlayerURL:[[NSBundle mainBundle] URLForResource:@"1.mp4" withExtension:nil] enterBlock:^{
NSLog(@"进入主页面");
[self enter];
} configuration:^(AVPlayerLayer *playerLayer) {
}];
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"firstStart"];
}else{
[self enter];
}
}
-(void)enter{
[UIApplication sharedApplication].statusBarHidden = NO;
UIViewController *vc = [[UIViewController alloc] init];
vc.view.backgroundColor = [UIColor brownColor];
self.window.rootViewController = vc;
[self.window.layer transitionWithAnimType:TransitionAnimTypeReveal subType:TransitionSubtypesFromRight curve:TransitionCurveDefault duration:2.0f];
}