您的位置:首页 > 移动开发

做出来IOS app第一次使用出来的指导介绍效果

2016-01-26 16:02 295 查看
在AppDelegate里面的入口类方法

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

里面添加代码

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

        

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

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

//此处写你第一次使用时要用到的指引界面(controller)

NewGuideVC * new = [[NewGuideVC alloc]init];//指导界面

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

        self.window.backgroundColor = [UIColor whiteColor];

        UINavigationController *nav = [[UINavigationController alloc]initWithRootViewController:new];

        nav.navigationBarHidden     = YES;

        self.window.rootViewController = nav;

        [self.window makeKeyAndVisible];
}else

{

      //跳转到你的首页或登录注册界面的代码

}

接下来在指导页的ViewController里操作指导动画,完成后添加跳到首页或者登录界面,并把指导页移除
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: