Skip to content

Instantly share code, notes, and snippets.

@funkyboy
Created April 1, 2014 13:45
Show Gist options
  • Save funkyboy/9914274 to your computer and use it in GitHub Desktop.
Save funkyboy/9914274 to your computer and use it in GitHub Desktop.
- (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