I have several imageViews
and I want to add one tapRecognizer
for all imageViews
.
So I know how to add tapRecognizer
.
let tapRecognizer = UITapGestureRecognizer(target: self, action: "imageTapped:")
imageViewOne.addGestureRecognizer(tapRecognizer)
It works, but I also want to add this for rest like
imageViewOne.addGestureRecognizer(tapRecognizer)
imageViewTwo.addGestureRecognizer(tapRecognizer)
imageViewThree.addGestureRecognizer(tapRecognizer)
imageViewFour.addGestureRecognizer(tapRecognizer)
...etc
But here the imageTapped
method will work only for the last one.
Question is: is it possible to do it not creating new tapRecognizers
for each imageView
?