Please note, this blog entry is from a previous course. You might want to check out the current one.
Your graphing view must support the following three gestures:
a. Pinching (zooms the entire graph, including the axes, in or out on the graph)
b. Panning (moves the entire graph, including the axes, to follow the touch around)
c. Double-tapping (moves the origin of the graph to the point of the double tap)
Let’s start by implement the handlers in the graph view class. Pinching zooms the view, thus we have to change the scale of the view:
func zoom(gesture: UIPinchGestureRecognizer) { if gesture.state == .Changed { scale *= gesture.scale gesture.scale = 1.0 } }
Continue reading “cs193p – Project #3 Assignment #3 Task #11”