Protocol
ADToolInteractable
public protocol ADToolInteractable
Use to control tool's interaction view.
Relationships
Types Conforming to ADToolInteractable
ADStickerInteractView
Shared view that you can add sticker to.
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
var zIndex: Int
Tool's interaction view z-Index in superview. The higher the value, the top the view.
interactClipBounds
var interactClipBounds: Bool
Whether interaction view clip to clip rect bounds when interacting.
clipingScreenInfo
var clipingScreenInfo: ADClipingInfo?
Interaction view clip info use to congfig .
shouldInteract(_:point:)
func shouldInteract(_ gesture: UIGestureRecognizer, point: CGPoint) -> Bool
Check if view can interact with gesture.
Parameters
Name | Type | Description |
---|---|---|
gesture | UIGestureRecognizer |
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
Name | Type | Description |
---|---|---|
type | ADInteractType |
Interaction gesture type. |
scale | CGFloat |
Interaction view's scale to orgin image size. |
state | UIGestureRecognizer.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()
func willBeginRenderImage()
Called before render view to image.
didEndRenderImage()
func didEndRenderImage()
Called after render view to image.