#import "AppDelegate.h"
#import "AppDefine.h"
#import "ResetLockViewController.h"
#import "LoginViewController.h"
@implementation AppDelegate
@synthesize window = _window;
@synthesize navigationController;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
ResetLockViewController *resetLockViewController = [[ResetLockViewController alloc] init];
LoginViewController *loginViewController = [[LoginViewController alloc] init];
NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
if ([userDefaults boolForKey:USERDEFAULTISAPPLOCKKEYSETTED]) {
self.navigationController = [[UINavigationController alloc] initWithRootViewController:loginViewController];
} else {
self.navigationController = [[UINavigationController alloc] initWithRootViewController:resetLockViewController];
}
[self.window addSubview:self.navigationController.view];
self.window.backgroundColor = [UIColor whiteColor];
[self.window makeKeyAndVisible];
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleBlackOpaque];
return YES;
}