I like to make PKCanvasView
to be scrollable and zoomable with underlay image. It seems it is okay to make it scrollable and zoomable without underlaying background image. But to make it with underlaying image I don’t know how to make it work.
Since PKCanvasView
is a subclass of UIScrollView
, I tried place custom content UIView
within scroll view, then set a delegate to specify that view for zooming. But PKCanvasView
’s drawing image and content view will not synchronize their positions when zooming, it’s okay with scrolling.
+ UIView (root view)
+ PKCanvasView
+ Custom UIView (underlaying image drawing)
Then I tried PKCanvasView
as just a content view within another UIScrollView
, treat PKCanvasView
as non-scrollable view. Then I synchronize the positions between PKCanvasView
’s drawing and container drawing image. However, I am not sure whether, PKCanvasView
may not be designed for being under another UIScrollView
, behavior of positioning ruler by finger isn’t stable, kept jumping place to place by dragging.
+ UIView (root view)
+ UIScrollView
+ Custom UIView (underlaying image drawing)
+ PKCanvasView
As far as I know, most of PKCanvasView
sample code work well without zooming with underlaying image. But once I set to maximumZoomScale
to 2 or more. Then it no longer synchronize drawings and underlaying background image.
Thanks