iosdevnyc
iosdevnyc

Reputation: 1871

Adding other views to UIButton

I want to add some views to a UIButton. For example multiple UILabels, UIImages, etc. One I add those views, they do not get the touch events. How can I pass the touch events to UIButton?

Thanks

Upvotes: 2

Views: 1528

Answers (1)

Clafou
Clafou

Reputation: 15400

Set the userInteractionEnabled property of each of the subviews you added to your UIButton to NO.

Upvotes: 5

Related Questions