UIControl fire its action to first responder instead of itself when there is first responder

Originator:pitiphong.ph
Number:rdar://23611650 Date Originated:19/11/2015
Status:Open Resolved:None
Product:iOS SDK Product Version:9
Classification:Bug Reproducible:Always
 
Summary:
In the documentation of UIResponder and UIControl, they say that
````
Action messages. When the user manipulates a control, such as a button or switch, and the target for the action method is nil, the message is sent through a chain of responders starting with the control view.
````
and
````
If this is nil, the responder chain is searched for an object willing to respond to the action message.
````
In my understanding, if the UIControl has `nil` target, it will fire its action messages to itself first and then through a responder chain starting from itself, but in iOS, the action message will fired to the first responder even that the current first responder is not in the UIControl responder chain

Steps to Reproduce:
1. Has a root view controller to be a containment controller
2. Has at least 2 view controller in the controller in 1.
3. Add a UIButton in one of the view controllers and add it action with nil target and implement the action method in this view controller
4. Make another view controller be the first responder.
5. Tap the button

Expected Results:
The action message is fired starting from UIButton and end up at the first view controller (which also called)

Actual Results:
The action message is fired starting from the the second view controller and no action method get called

Version:
iOS 9

Notes:


Configuration:
iOS SDK

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!