0

So I dragged a pinch gesture recognizer into my storyboard and hooked that up to an IBAction to feed an image into an ImageView when the user does the pinch motion. However when I run the simulator and do the pinch motion with the option key and everything, nothing happens/ is recognized. What's going on?

My code:

@IBAction func pinchGesture(sender: UIPinchGestureRecognizer) {
        eggView.image = UIImage (named: "Easter_egg")
    }
rmaddy
  • 314,917
  • 42
  • 532
  • 579
blue
  • 7,175
  • 16
  • 81
  • 179

1 Answers1

0

I've encountered the same problem. It seems to be gesture recognizer don't properly added to the view and the solution is to add gesture recognizer programatically by self.view.addGestureRecognizer(gestureRecognizer:) in viewDidLoad()

Andrey M.
  • 3,021
  • 29
  • 42