Skip to content

Instantly share code, notes, and snippets.

@anthonycvella
Created February 1, 2013 18:32
Show Gist options
  • Save anthonycvella/4693134 to your computer and use it in GitHub Desktop.
Save anthonycvella/4693134 to your computer and use it in GitHub Desktop.
- (IBAction)btnLogout:(id)sender {
TabBarViewController *tabBarViewControllerObj = [[TabBarViewController alloc] init];
[Lockbox setString:@"FALSE" forKey:kLoggedinStatusKeyString];
[tabBarViewControllerObj loginCheck];
}
#import <UIKit/UIKit.h>
@interface TabBarViewController : UITabBarController
- (void)loginCheck;
@end
- (void)loginCheck
{
UIStoryboard *mainstoryboard = self.storyboard;
LoginViewController* loginViewController = [mainstoryboard instantiateViewControllerWithIdentifier:@"LoginViewController"];
if ([[Lockbox stringForKey:kLoggedinStatusKeyString] isEqualToString:@"FALSE"]) {
[self presentViewController:loginViewController animated:NO completion:nil];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment