UIView hitTest:withEvent behavior changes after backgrounding

Originator:brianpartridge
Number:rdar://10434549 Date Originated:11-Nov-2011
Status:Duplicate of 10188882 Resolved:No
Product:iOS Product Version:5.0
Classification:Serious Bug Reproducible:Yes
 
Summary:
After an app returns from the background, a fullscreen UIView's hitTest:withEvent method will fire for touches that should be going to the on screen keyboard.

Steps to Reproduce:
- Subclass UIView as MyView and override hitTest:withEvent: to log when it is called.
- Create an app with 2 views:
  - 1 Fullscreen MyView (768x1024)
  - 1 UITextView (200x200) in the center of the MyView, as a subview

- Launch the app.
- Tap the textfield.
  - You will see hitTest logged the touch event. The textfield became first responder and the keyboard appeared.  Tapping elsewhere in the fullscreen view will log similar events.
- Tap on the keyboard.
  - You will see that hitTest does not log these touch events. Characters appear in the textfield.
- Dimiss the keyboard.
- Send the app to the background.
- Resume the app.
- Tap the textview to make it first responder.
  - You will see hitTest logged the touch event. The textfield became first responder and the keyboard appeared.
- Tap on the keyboard.
  - You will see that now hitTest DOES log these touch events. Characters appear in the textfield.

Expected Results:
MyView's hitTest should be called consistently for touches to the keyboard whether the app has been in the background or not.

Actual Results:
MyView's hitTest is called inconsistently.

Regression:
Unsure, see notes.

Notes:
I haven't been able to test this on earlier versions of iOS.  This behavior is only apparent on device so I could not reproduce it in earlier versions of the simulator.

Comments

A few findings on the same problem

This did not happen on previous SDKs. Not reproducible on Simulator. Affects all devices

By colnaghijr at Nov. 12, 2011, 1:16 p.m. (reply...)

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!