MDCInkTouchControllerDelegate

@protocol MDCInkTouchControllerDelegate <NSObject>

Delegate methods for MDCInkTouchController.

  • Inserts the ink view into the given view.

    If this method is not implemented, the ink view is added as a subview of the view when the controller’s addInkView method is called. Delegates can choose to insert the ink view below the contents as a background view. When inkTouchController:inkViewAtTouchLocation is implemented this method will not be invoked.

    Declaration

    Objective-C

    - (void)inkTouchController:(nonnull MDCInkTouchController *)inkTouchController
                 insertInkView:(nonnull UIView *)inkView
                      intoView:(nonnull UIView *)view;

    Parameters

    inkTouchController

    The ink touch controller.

    inkView

    The ink view.

    view

    The view to add the ink view to.

  • Returns the ink view to use for a touch located at location in inkTouchController.view.

    If the delegate implements this method, the controller will not create an ink view of its own and inkTouchController:insertInkView:intoView: will not be called. This method allows the delegate to control the creation and reuse of ink views.

    Declaration

    Objective-C

    - (nullable MDCInkView *)inkTouchController:
                                 (nonnull MDCInkTouchController *)inkTouchController
                         inkViewAtTouchLocation:(CGPoint)location;

    Parameters

    inkTouchController

    The ink touch controller.

    location

    The touch location in the coords of @c inkTouchController.view.

    Return Value

    An ink view to use at the touch location.

  • Controls whether the ink touch controller should be processing touches.

    The touch controller will query this method to determine if it should start or continue to process touches controlling the ink. Returning NO at the start of a gesture will prevent any ink from being displayed, and returning NO in the middle of a gesture will cancel that gesture and evaporate the ink.

    If not implemented then YES is assumed.

    See

    cancelInkTouchProcessing

    Declaration

    Objective-C

    - (BOOL)inkTouchController:(nonnull MDCInkTouchController *)inkTouchController
        shouldProcessInkTouchesAtTouchLocation:(CGPoint)location;

    Parameters

    inkTouchController

    The ink touch controller.

    location

    The touch location relative to the inkTouchController view.

    Return Value

    YES if the controller should process touches at @c location.

  • Notifies the receiver that the ink touch controller did process an ink view at the touch location.

    Declaration

    Objective-C

    - (void)inkTouchController:(nonnull MDCInkTouchController *)inkTouchController
             didProcessInkView:(nonnull MDCInkView *)inkView
               atTouchLocation:(CGPoint)location;

    Parameters

    inkTouchController

    The ink touch controller.

    inkView

    The ink view.

    location

    The touch location relative to the inkTouchController superView.