TWTweetComposer completionHandler blocks touch input

Originator:invalidname
Number:rdar://10702161 Date Originated:1/16/12
Status:open Resolved:
Product:iPhone SDK Product Version:5.0
Classification:serious bug Reproducible:always
 
16-Jan-2012 04:57 PM Chris Adamson:
Summary:
When a completionHandler block is added to TWTweetComposeViewController, the completion handler needs to call -[UIViewController dismissModalViewControllerAnimated:], even though the view for the tweet composer dismisses itself with its cancel or send buttons. Failure to do so causes touch events to not reach the view that spawned the tweet composer.

Steps to Reproduce:
Build and run the attached PRPFirstProjectTweeter project. This is sample code from our "iOS SDK Development" book (apologies for the funny-looking comments... these are used to import the code into the book's text).

In PRPViewController, locate line 82:
      [self dismissModalViewControllerAnimated:YES]; //<label id="sect.programmingios.blocks.completionhandler.dismissmodalviewcontroller"/>

Delete this line or comment it out.  Run the app on the simulator or the device (switch to Settings to configure a Twitter account, if necessary).

Tap the "I completed the first project" button. This shows the tweet composer.  Edit the text if desired, and tap send.  The tweet composer disappears.

Expected Results:
The rest of the user interface should continue to be usable.

Actual Results:
Taps on the buttons are not received once the tweet composer disappears.  The app is basically bricked.

Regression:
This problem only occurs once you have set a completionHandler on the TWTweetComposeViewController. If you do not set this property, the original view remains tappable after the tweet composer dismisses.

Notes:
This might be a documentation bug, as there is nothing in the completionHandler property's documentation to indicate that the modal tweet composer must explicitly be dismissed by its completionHandler.  Since the view animates its own disappearance, it is not intuitive that a manual dismissal by the VC that spawned the tweet composer would be necessary.


16-Jan-2012 04:57 PM Chris Adamson:
'PRPFirstProjectTweeter04.zip' was successfully uploaded

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!