Created
April 1, 2014 13:45
-
-
Save funkyboy/9914274 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)viewWillAppear:(BOOL)animated { | |
[super viewWillAppear:animated]; | |
BAAClient *client = [BAAClient sharedClient]; | |
if (client.isAuthenticated) { | |
NSLog(@"Logged in"); | |
[SMPost getObjectsWithCompletion:^(NSArray *objects, NSError *error) { | |
_posts = [objects mutableCopy]; | |
[self.tableView reloadData]; | |
}]; | |
} else { | |
NSLog(@"need to login/signup"); | |
SMLoginViewController *loginViewController = [[SMLoginViewController alloc] initWithNibName:@"SMLoginViewController" | |
bundle:nil]; | |
[self.navigationController presentViewController:loginViewController | |
animated:YES | |
completion:nil]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment