// Created by lyz on 15-8-24.
// Copyright (c) 2015年 mac. All rights reserved.
//
#import "AppDelegate.h"
//#import "MainTabBarController.h"
#import "FastComeViewController.h"
#import "LunchViewController.h"
@interface AppDelegate ()
@end
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
UIWindow *window = [[UIWindow alloc]initWithFrame:[UIScreen mainScreen].bounds];
window.backgroundColor = [UIColor whiteColor];
self.window = window;
[self.window makeKeyAndVisible];
//创建标签控制器
//先找文件,判断是否存在
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
BOOL value = [defaults boolForKey:@"isnext"];
if (value == YES)
{// 不是第一次
NSLog(@"不是第一次进入");
UIStoryboard *storyBoard = [UIStoryboard storyboardWithName:@"Lunch" bundle:nil];
LunchViewController *lunch = [storyBoard instantiateViewControllerWithIdentifier:@"Lunch"];
self.window.rootViewController = lunch;
}else{
//第一次
NSLog(@"第一次进入");
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setBool:YES forKey: @"isnext"];
//同步数据
[defaults synchronize];
FastComeViewController *tabarVC = [[FastComeViewController alloc]init];
tabarVC.view.layer.transform = CATransform3DMakeScale(.5, .5, 0);
self.window.rootViewController = tabarVC;
[UIView animateWithDuration:1 animations:^{
tabarVC.view.layer.transform = CATransform3DIdentity;
}];
//application.statusBarHidden = NO;
}
//状态栏
[application setStatusBarStyle:UIStatusBarStyleLightContent];
return YES;
}
iOS应用启动流程解析
本文详细介绍了iOS应用的启动流程,包括如何通过检查用户偏好设置来决定显示不同的初始视图控制器,并采用不同的动画效果。此外,还展示了如何根据不同条件设置应用的状态栏样式。
1469

被折叠的 条评论
为什么被折叠?



