Skip to content

ADToolInteractable

duzexu edited this page Sep 18, 2021 · 1 revision

ADToolInteractable

Use to control tool's interaction view.

public protocol ADToolInteractable 

Default Implementations

shouldInteract(_:point:)

public func shouldInteract(_ gesture: UIGestureRecognizer, point: CGPoint) -> Bool 

interact(with:scale:state:)

public func interact(with type: ADInteractType, scale: CGFloat, state: UIGestureRecognizer.State) -> TimeInterval? 

willBeginRenderImage()

public func willBeginRenderImage() 

didEndRenderImage()

public func didEndRenderImage() 

Requirements

zIndex

Tool's interaction view z-Index in superview. The higher the value, the top the view.

var zIndex: Int 

strategy

Tool's interaction view response strategy.

var strategy: ADInteractStrategy 

interactClipBounds

Whether interaction view clip to clip rect bounds when interacting.

var interactClipBounds: Bool 

clipingScreenInfo

Interaction view clip info use to congfig .

var clipingScreenInfo: ADClipingInfo? 

shouldInteract(_:​point:​)

Check if view can interact with gesture.

func shouldInteract(_ gesture: UIGestureRecognizer, point: CGPoint) -> Bool

Parameters

  • gesture: User interaction gesture.
  • point: Gesture location in view.

Returns

Return true if view can response user's interaction. Otherwise, return false.

interact(with:​scale:​state:​)

Do some action with user interaction.

func interact(with type: ADInteractType, scale: CGFloat, state: UIGestureRecognizer.State) -> TimeInterval?

Parameters

  • type: Interaction gesture type.
  • scale: Interaction view's scale to orgin image size.
  • state: Interaction gesture state.

Returns

Return delay time of interaction view become clip when interactClipBounds is false. Return nil or 0 means no delay.

willBeginRenderImage()

Called before render view to image.

func willBeginRenderImage()

didEndRenderImage()

Called after render view to image.

func didEndRenderImage()
Types
Protocols
Global Typealiases
Operators
Extensions
Clone this wiki locally