1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- //
- // FLIntroductionHelper.m
- // FirstLink
- //
- // Created by unicode on 14-9-28.
- // Copyright (c) 2014年 FirstLink. All rights reserved.
- //
- #import "FKGuideManager.h"
- #import "FirstLinkAppDelegate.h"
- #import "FLControllerHelper.h"
- #import "FKSexGuideController.h"
- #import "GuideViewController.h"
- #define SUCCESS_SHOW_ONCE_GUIDE @"SUCCESS_SHOW_ONCE_GUIDE"
- @implementation FKGuideManager
- + (BOOL)isNeedShowGuideController {
- if ([FKGuideManager isFirstLaunchApplication]
- || [SystemUtil isApplicationUpdate]) {
- return YES;
- }
- return NO;
- }
- + (void)showGuideController {
- UITabBarController *tabbarController = (UITabBarController*)[[UIApplication sharedApplication] keyWindow].rootViewController;
- if ([tabbarController isKindOfClass:[UITabBarController class]]) {
- UIViewController *newViewController = [[FLControllerHelper currentStoryBoard] instantiateViewControllerWithIdentifier:@"GuideViewController"];
- [[FLControllerHelper currentController] presentViewController:newViewController animated:NO completion:^{
-
- }];
- }
- }
- + (BOOL)isFirstLaunchApplication {
- NSUserDefaults *userDefault = [NSUserDefaults standardUserDefaults];
- NSInteger count = [userDefault integerForKey:SUCCESS_SHOW_ONCE_GUIDE];
- if (!count) {
- return YES;
- }
- return NO;
- }
- + (BOOL)successShowOnceGuide {
- NSUserDefaults *userDefault = [NSUserDefaults standardUserDefaults];
- NSInteger count = [userDefault integerForKey:SUCCESS_SHOW_ONCE_GUIDE];
-
- [userDefault setInteger:(count + 1) forKey:SUCCESS_SHOW_ONCE_GUIDE];
- return [userDefault synchronize];
- }
- @end
|