iOS Bootstrap page launches once

2667 단어 ios
#import "AppDelegate.h"



@implementation AppDelegate



- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

{

    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

    // Override point for customization after application launch.

    self.window.backgroundColor = [UIColor whiteColor];

    

    // , ...

    if (![[NSUserDefaults standardUserDefaults] boolForKey:@"everLaunched"]) {

        [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"everLaunched"];

        [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"firstLaunch"];

    }

    

    

    

    if ([[NSUserDefaults standardUserDefaults] boolForKey:@"firstLaunch"]) {

        ViewController *appStartController = [[ViewController alloc] init];

        self.window.rootViewController = appStartController;

    }else {

        //NextViewController *mainViewController = [[NextViewController alloc] init];

        //self.window.rootViewController=mainViewController;

    }

    [self.window makeKeyAndVisible];

    return YES;

}

좋은 웹페이지 즐겨찾기