ScratchCardViewDelegate
@objc public protocol ScratchCardViewDelegate: class
The ScratchCardViewDelegate interface
-
The top view of the scratch card. Covers the content view.
Declaration
Swift
func coverView(for scratchCardView: ScratchCardView) -> UIView
Parameters
scratchCardView
the view that asks for the cover view.
Return Value
The method should return a cover view for the scratch card
-
The content view of the scratch card. It is initialy covered and is revealed after scratching the view.
Declaration
Swift
func contentView(for scratchCardView: ScratchCardView) -> UIView
Parameters
scratchCardView
The view that asks for the content view.
Return Value
The method should return a content view for the scratch card
-
Gets called when scratching starts
Declaration
Swift
@objc optional func scratchCardView(_ view: ScratchCardView, didStartScratchingAt point: CGPoint)
Parameters
view
The scratch card
point
The point at which the scratches started. In the scratch card coordinate system
-
Called when scratches are in progress
Declaration
Swift
@objc optional func scratchCardView(_ view: ScratchCardView, didScratchTo point: CGPoint)
Parameters
view
The scratch card
point
The point to which the scratching finger moved. In the scratch card coordinate system
-
Called when current scratches stop (user lifts his finger)
Declaration
Swift
@objc optional func scratchCardViewDidEndScratching(_ view: ScratchCardView)
Parameters
view
The scratch card