Interface PKCanvasViewDelegate

  • All Superinterfaces:
    UIScrollViewDelegate

    public interface PKCanvasViewDelegate
    extends UIScrollViewDelegate
    The optional methods a delegate can receive from editing-related changes to a PKCanvasView.
    • Method Detail

      • canvasViewDidBeginUsingTool

        default void canvasViewDidBeginUsingTool​(PKCanvasView canvasView)
        Called when the user starts using a tool, eg. selecting, drawing, or erasing. This does not include moving the ruler.
        Parameters:
        canvasView - The canvas view that the user started interacting with.
      • canvasViewDidEndUsingTool

        default void canvasViewDidEndUsingTool​(PKCanvasView canvasView)
        Called when the user stops using a tool, eg. selecting, drawing, or erasing.
        Parameters:
        canvasView - The canvas view that the user ended interacting with.
      • canvasViewDidFinishRendering

        default void canvasViewDidFinishRendering​(PKCanvasView canvasView)
        Called after setting `drawing` when the entire drawing is rendered and visible. This method lets you know when the canvas view finishes rendering all of the currently visible content. This can be used to delay showing the canvas view until all content is visible. This is called every time the canvasView transitions from partially rendered to fully rendered, including after setting the drawing, and after zooming or scrolling.
        Parameters:
        canvasView - The canvas view that finished rendering.
      • canvasViewDrawingDidChange

        default void canvasViewDrawingDidChange​(PKCanvasView canvasView)
        Called after the drawing on the canvas did change. This may be called some time after the `canvasViewDidEndUsingTool:` delegate method. For example, when using the Apple Pencil, pressure data is delayed from touch data, this means that the user can stop drawing (`canvasViewDidEndUsingTool:` is called), but the canvas view is still waiting for final pressure values; only when the final pressure values are received is the drawing updated and this delegate method called. It is also possible that this method is not called, if the drawing interaction is cancelled.
        Parameters:
        canvasView - The canvas view that changed.