ios - Different Tap Recognizer for Subviews -
i using uiview
container hold uilabel
, uiimageview
.
i want both uilabel
, uiimageview
have uitaprecognizer
but: different functions.
let gesture3 = uitapgesturerecognizer(target: self, action: #selector(chatviewcontroller.clickongroupimage(_:))) imageview.addgesturerecognizer(gesture3) let gesture2 = uitapgesturerecognizer(target: self, action: #selector(chatviewcontroller.clickonbutton(_:))) labelview.addgesturerecognizer(gesture2)
now after putting both subviews container, not able click them (it worked fine, when tested both methods on single container).
any ideas?
make sure userinteractionenabled
true
views applying gestures (imageview
, labelview
in case), enable user interaction container.
Comments
Post a Comment