Skip to content

Instantly share code, notes, and snippets.

@jontelang
Created June 12, 2014 16:39
Show Gist options
  • Save jontelang/3cb1fceec309ef2c546c to your computer and use it in GitHub Desktop.
Save jontelang/3cb1fceec309ef2c546c to your computer and use it in GitHub Desktop.
else if(buttonIndex==5)
{
NSLog(@"[Snapper] Share pressed");
UIViewController *vc = [[UIViewController alloc] init];
self.rootViewController = vc;
UIActivityViewController *activityController = [[UIActivityViewController alloc] initWithActivityItems:@[imageView.image] applicationActivities:nil];
isShowingShare = YES;
// Avoid share menu not respodning
[self removePan];
activityController.completionHandler = ^(NSString *activityType, BOOL completed){
NSLog(@"[Snapper] Done? %@ %i %i",activityType,completed,isShowingShare);
isShowingShare = NO;
// Add pan again, since we took it away before.
[self placePan];
if( activityType == Nil ){
[self showActivitySheet];
}
else{
[self dismiss];
}
};
[vc presentViewController:activityController animated:YES completion:Nil];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment