Last active
August 29, 2015 14:22
-
-
Save dcosson/2defd0bd596f00e14f60 to your computer and use it in GitHub Desktop.
Add an extra share button to mave
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
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