I have some social sharing code that looks like this:
SLComposeViewController *composer = [SLComposeViewController composeViewControllerForServiceType:…];
[composer setInitialText:…];
[composer addURL:…];
[composer setCompletionHandler:^(SLComposeViewControllerResult result) {
[someController dismissViewControllerAnimated:YES completion:^{
… // 1
}];
}];
[someController presentModalViewController:composer animated:YES];
The problem is that the code behaves differently for Facebook and Twitter. When the user confirms the Facebook compose screen, the composer apparently dismisses itself, because the completion handler marked as 1 is never called and even when I remove the dismissViewControllerAnimated:
call, everything works fine.
On the other hand, when user confirms the Twitter compose screen and I don’t dismiss it by hand, the compose screen slides out, but the app stays stuck, like some controller is still in foreground. When I add the dismissViewControllerAnimated:
call, the problem disappears and the completion handler (1) is called correctly.
Did you also notice this behaviour? Am I doing something wrong? This is current iOS 6, sample code on GitHub. I have reported the problem to Apple (Radar #12642889), no reaction yet.