I think it's a concept error. That is, make your application go directly to UIViewController
that will appear after login, and present this screen in the viewWillAppear
of the original VC. Then, when you jump%% of% you just have to do UIAlertController
of the login VC.
Something like this should work:
override func viewWillAppear(animated: Bool) {
let defaults = NSUserDefaults.standardUserDefaults()
if ((defaults.objectForKey("firstRun") == nil)) {
defaults.setObject(NSDate(), forKey: "firstRun")
let loginVC = UIViewController()
self.presentViewController(loginVC, animated: true, completion: nil)
}
}
In Objective C:
- (void)viewWillAppear:(BOOL)animated {
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
if (![defaults objectForKey:@"firstRun"]) {
[defaults setObject:[NSDate date] forKey:@"firstRun"];
[[NSUserDefaults standardUserDefaults] synchronize];
UIViewController *loginVC = [[UIViewController alloc] init];
[self presentViewController:loginVC animated:YES completion:nil];
}
}