ADPhotoKit Documentation

Protocol ADTool​Interactable

public protocol ADToolInteractable  

Use to control tool's interaction view.

%247 ADToolInteractable ADToolInteractable ADStickerInteractView ADStickerInteractView ADStickerInteractView->ADToolInteractable ADDrawInteractView ADDrawInteractView ADDrawInteractView->ADToolInteractable

Types Conforming to ADTool​Interactable

ADStickerInteractView

Shared view that you can add sticker to.

Default Implementations

should​Interact(_:​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?  

will​Begin​Render​Image()

public func willBeginRenderImage()  

did​End​Render​Image()

public func didEndRenderImage()  

Requirements

zIndex

var zIndex: Int  

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

strategy

var strategy: ADInteractStrategy  

Tool's interaction view response strategy.

interact​Clip​Bounds

var interactClipBounds: Bool  

Whether interaction view clip to clip rect bounds when interacting.

cliping​Screen​Info

var clipingScreenInfo: ADClipingInfo?  

Interaction view clip info use to congfig .

should​Interact(_:​point:​)

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

Check if view can interact with gesture.

Parameters

gesture UIGesture​Recognizer

User interaction gesture.

point CGPoint

Gesture location in view.

Returns

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

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

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

Do some action with user interaction.

Parameters

type ADInteract​Type

Interaction gesture type.

scale CGFloat

Interaction view's scale to orgin image size.

state UIGesture​Recognizer.​State

Interaction gesture state.

Returns

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

will​Begin​Render​Image()

func willBeginRenderImage() 

Called before render view to image.

did​End​Render​Image()

func didEndRenderImage() 

Called after render view to image.