I\'m drawing a graph on a UIView
, which is contained by a UIScrollView
so that the user can scroll horizontally to look around the entire graph.
Edsko & bshirley answers are good, but they don't tell where to place the code.
First, I placed it in viewDidLoad
method, but no Pinch Gesture Recognizer was found in the scrollview (maybe because my scrollview is an IBOutlet).
Then I tried in viewWillAppear
or viewDidAppear
and the UIPinchGestureRecognizer
was here.