如何实现app文件,第一次使用时的启动画面

//  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;

}




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值