1

I am currently implementing a UIActivityViewController in my app, and it's working great. If I select an action (Post to FB, Save Image, etc) then it works well and my UI responds afterwards. However, if I press cancel, the activity view is dismissed (visually) but my UI freezes (doesn't respond to touch).

This happens on my iPhone 5. However, it does not occur in the simulator.

    - (IBAction)share:(id)sender {
    NSString *myString = @"Download our game & beat our score.";
    NSURL *myURL = [NSURL URLWithString:@"http://myurl"];

    UIActivityViewController *activityViewController = [[UIActivityViewController alloc] initWithActivityItems:@[myString, myURL, _resultsImage]applicationActivities:nil];

    activityViewController.excludedActivityTypes = @[UIActivityTypeAirDrop, UIActivityTypeAddToReadingList, UIActivityTypeAssignToContact, UIActivityTypeCopyToPasteboard, UIActivityTypePostToVimeo, UIActivityTypePrint];

    [self presentViewController:activityViewController animated:YES completion:nil];

    activityViewController.completionHandler = ^(NSString *activityType, BOOL completed) {
        if ( completed ) {

            NSLog(@"Action Completed");
        } else {

            NSLog(@"Action Canceled");
            //If this takes place my UI freezes
        }
    };
}

What's wrong here?

GenieWanted
  • 4,473
  • 4
  • 24
  • 35
KingPolygon
  • 4,753
  • 7
  • 43
  • 72
  • possible duplicate of [UIActivityViewController not dismissing](http://stackoverflow.com/questions/16227093/uiactivityviewcontroller-not-dismissing) – Aaron Brager Jun 12 '14 at 05:06
  • 1
    @AaronBrager Not exactly. The other question mentions choosing an action (Mailing) and once that's done rather than dismiss the activity indicator automatically, he has to press cancel manually. That's not my issue. That works for me automatically. My issues is that if I cancel without selecting an action, it dimisses but my UI freezes. – KingPolygon Jun 12 '14 at 05:09
  • Ah, I understand. Close vote retracted. Which versions of iOS does this occur on? – Aaron Brager Jun 12 '14 at 05:56
  • No worries so it's actually weird. I asked a friend to test it on their 4S on iOS 7, and it showed no issue. I'm using iOS 8 so perhaps that could be the issue. – KingPolygon Jun 12 '14 at 06:40
  • Yeah, I would make a small test project to reproduce the issue and submit it to http://bugreport.apple.com. – Aaron Brager Jun 12 '14 at 19:45

0 Answers0