In my program I have placed a UIButton as a subview of a UIView, both of which have userInteractionEnabled set to true. When the button is tapped, an event is called to handle the button tap, which works as expected. However, the button’s UIView superview also handles an event which should not be triggered in this case. Can anybody explain why the UIButton AND UIView are both triggering an event? Any help is appreciated.
In my program I have placed a UIButton as a subview of a UIView
Share
I have found a solution: I simply made the button a superview of the view which was handling unwanted events, rather than a subview.