I am trying to display a new image based on a user tapping the image view. I have added a UITapGestureRecognizer on top of the UIImageView which has been defined a "displayPhoto" and connected it as an outlet to the view controller.
@IBOutlet weak var displayPhoto: UIImageView! @IBAction func changeImage(_ sender: UITapGestureRecognizer) { displayPhoto.image = UIImage(named: "myimage") } The sent action is listed as follows:
When I run the app and click on the image, nothing happens. I've even tried to make the first line of the IBAction function a fatal error but nothing happens. What am I missing?
Thanks in advance for any help.