Skip to content

Instantly share code, notes, and snippets.

@stuffmc
Created January 10, 2012 11:55
Show Gist options
  • Save stuffmc/1588654 to your computer and use it in GitHub Desktop.
Save stuffmc/1588654 to your computer and use it in GitHub Desktop.
GTMOAuth2ViewControllerTouch *viewController = [GTMOAuth2ViewControllerTouch controllerWithScope:scope
clientID:CLIENT_ID
clientSecret:CLIENT_SECRET
keychainItemName:kKeychainItemName
completionHandler:completionHandler];
UIViewController *parentViewController = viewController;
if (![self.delegate isKindOfClass:[UINavigationController class]]) {
self.navigationController = [[[UINavigationController alloc] initWithRootViewController:viewController] autorelease];
self.navigationController.navigationBar.translucent = YES;
UIBarButtonItem *leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self.delegate action:@selector(dismissViewControllerAnimated:completion:)];
self.navigationController.navigationItem.leftBarButtonItem = leftBarButtonItem;
// [leftBarButtonItem release];
parentViewController = self.navigationController;
}
parentViewController.modalTransitionStyle = self.delegate.modalTransitionStyle;
[self.delegate presentViewController:parentViewController animated:YES completion:^{
NSLog(@"Google Sign In presented");
}];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment