I have created a view which has an object img
which is a subclass of UIImageView
and I have added the touchesEnded
method to the img
class. But when I click on the img
class object, the touchesEnded event
is not triggered.
Does any开发者_如何学Pythonone have an idea what may be wrong, please?
Thank you!
UIImageView
by default has userInteractionEnabled
property set to NO so it does not track any touch events. Try to set userInteractionEnabled to YES
精彩评论