How recognize which UIImageview I've tapped?
问题 I want to realize a sort of matrix editable by touch. A series of black or white cell that if tapped switch form black to withe or viceversa. For doing this i will use UIImageView arranged in stack view a Tap Gesture Recognizer. But how do I know which UIImageView was tapped? And in which way I can change the UIImage in the UIImageView? 回答1: If they are just white and black, it would be much simpler to use a UIView and set its backgroundColor to .white or .black . You can use the tag property