Skip to content

Instantly share code, notes, and snippets.

@dcosson
Last active August 29, 2015 14:22
Show Gist options
  • Save dcosson/2defd0bd596f00e14f60 to your computer and use it in GitHub Desktop.
Save dcosson/2defd0bd596f00e14f60 to your computer and use it in GitHub Desktop.
Add an extra share button to mave
MaveSDK *mave = [MaveSDK sharedInstance];
[mave presentInvitePageModallyWithBlock:^(UIViewController *inviteController) {
if ([inviteController isKindOfClass:[UINavigationController class]]) {
UINavigationController *navController = (UINavigationController *)inviteController;
// Here replace the method "foo" with your method to present a share sheet
// And you can of course use a button with an image instead of the title "Share"
UIBarButtonItem *shareButton = [[UIBarButtonItem alloc] initWithTitle:@"Share"
style:UIBarButtonItemStylePlain
target:self action:@selector(foo)];
navController.topViewController.navigationItem.rightBarButtonItem = shareButton;
}
[self presentViewController:inviteController animated:YES completion:nil];
} dismissBlock:^(UIViewController *controller, NSUInteger numberOfInvitesSent) {
[controller dismissViewControllerAnimated:YES completion:nil];
} inviteContext:@"home-page-modal"];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment