27 首次登陆&新特性跳转

#importextern NSString *const IsFirstOpenApp;

extern NSString *const GuideViewControllerDidFinish;


#importNSString * const IsFirstOpenApp = @"isFirstOpenApp";

NSString * const GuideViewController = @"GuideViewControllerDidFinish";



#import "AppDelegate.h"

#import "AppConst.h"

#import "GuideViewController.h"

#import "MainTabBarController.h"

@interface AppDelegate ()

@end

@implementation AppDelegate

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

[self addNotification];

[self buildKeyWindow];

return YES;

}

- (void)buildKeyWindow {

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

[self.window makeKeyAndVisible];

NSString *isFirstOpenApp = [[NSUserDefaults standardUserDefaults]objectForKey:IsFirstOpenApp];

if (isFirstOpenApp == nil) {

self.window.rootViewController = [[GuideViewController alloc]init];

[[NSUserDefaults standardUserDefaults] setObject:IsFirstOpenApp forKey:IsFirstOpenApp];

}else {

[self loadAdRootController];

}

}

- (void)addNotification{

//    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(showMainTabBarController) name:GuideViewControllerDidFinish object:nil];

}

- (void)showMainTabBarController {

self.window.rootViewController = [[MainTabBarController alloc]init];

}

- (void)loadAdRootController {

self.window.rootViewController = [[MainTabBarController alloc]init];

}

//- (void)dealloc {

//

//    [[NSNotificationCenter defaultCenter]removeObserver:self];

//}




#import "GuideViewController.h"

#import "AppConst.h"

@interface GuideViewController ()

@property (nonatomic,strong) UIButton *button;

@end

@implementation GuideViewController

- (void)viewDidLoad {

[super viewDidLoad];

self.view.backgroundColor = [UIColor blueColor];

//    self.button = [[UIButton alloc]init];

//    self.button setBackgroundImage:<#(nullable UIImage *)#> forState:<#(UIControlState)#>

//    self.button.hidden = true;

//    [self.button addTarget:self action:@selector(nextButtonClicked:) forControlEvents:UIControlEventTouchUpInside];

//    [self.view addSubview:_button];

}

- (void)nextButtonClicked:(UIButton *)button {

//    [[NSNotificationCenter defaultCenter]postNotificationName:GuideViewControllerDidFinish object:nil];

}

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

友情链接更多精彩内容