bobbyali / PhotoNote

An iOS app for annotating photos, done during Thinkful iOS bootcamp.
0 stars 0 forks source link

How can I enable pinch-to-zoom and also swipe-to-draw? #1

Open bobbyali opened 9 years ago

bobbyali commented 9 years ago

In the PhotoViewController (which shows the photo and lets users draw on it), I would like to enable pinch-to-zoom as well. I read online that this can be done by using a UIScrollView, but when I tried this, it blocked the drawing functionality. Any thoughts?

bobbyali commented 9 years ago

Ah, I think it's because UIScrollView's basic scrolling functionality will interfere with the drawing. So I need to implement the pinch-to-zoom functionality without using the scrollview...

bobbyali commented 9 years ago

Nope, tried this and still doesn't work...

bobbyali commented 9 years ago

http://stackoverflow.com/questions/9281220/cgcontextstrokepath-not-working-when-zooming-and-drawing-images

Had some good ideas. Tested touches.count but always returns 1, even with 2 fingers. So can't even detect a pinch gesture... odd...

bobbyali commented 9 years ago

Set number of touches required. And disable drawing - close the context, render the image to the view, then start the rescaling.