Question

I have encountered an issue where an app will freeze when dismissViewControllerAnimated is called.

It is called on the root viewcontroller (something I find suspicious), and happen when the when the user has chosen Facebook from a UIActivityController. It doesn't affect Twitter or Mail (the only other activities exposed). It also only happens on device.

So the flow is:

  1. User initiates the UIActivityViewController Controller which shows various avenues to share content.

  2. User chooses "facebook"

  3. Post to facebook view is shown

  4. (essentially) [[UIWindow rootViewController] dismissViewControllerAnimated] called, which freezes before returning.

I was curious either -

  • if anyone has seen this behaviour and has a solution, or at least
  • what are things that could cause dismissViewControllerAnimated to freeze.
Was it helpful?

Solution

I don't have an answer to the source of the freeze, however I was able to resolve the issue by dismissing the UIActivityController directly. Previously it was dismissed via the controller that presented it.

The best hypothesis I can come up with is the facebook controller (unlike the ones for mail or twitter) adjusts the relationship of the UIActivityController so that its presenting controller changes. After that it cannot be dismissed the way I was (note: my knowledge is iOS UI is pretty scant so I could be terribly wrong). I don't get why that would cause it to freeze though

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top