0

I'm using UIActivityViewController for social sharing purposes, and I need to log what social network has being used. I know that I should use typedef void (^UIActivityViewControllerCompletionHandler)(NSString *activityType, BOOL completed); and activityType will give me the string that i need, but I don't know how to implement syntactically. Please, can anyone help me get the direction, I'm very newbie.

rmaddy
  • 314,917
  • 42
  • 532
  • 579
pulp
  • 1,768
  • 2
  • 16
  • 24
  • Look there: http://stackoverflow.com/questions/12552414/uiactivityviewcontrollercompletionhandler-how-to and check the `activityType` in the block. – Larme Apr 24 '14 at 13:12
  • @Larme thank you for quick response, I've seen this thread, but I should pay some attention to answer below the accepted. Sorry for disturbance. – pulp Apr 24 '14 at 13:31

1 Answers1

0

Ok, for those who need syntax on how to get activityType

[yourUIActivityViewController setCompletionHandler:^(NSString *activityType, BOOL completed) {
        NSLog(@"activity: %@ isCompleted: %d", activityType, completed);
}];

based on very helpful answer and quick response of @Larme

Community
  • 1
  • 1
pulp
  • 1,768
  • 2
  • 16
  • 24