Button
@objc(PESDKButton) open class Button: UIButton
A Button
is a subclass of UIButton
, which supports running a closure for a given control event
and has the ability to specify a touch area inset.
-
Associates a closure with the control.
Declaration
Swift
open func setActionClosure(_ actionClosure: ((AnyObject) -> Void)?, for controlEvents: UIControlEvents)
Parameters
actionClosure
The closure to associate with the control.
controlEvents
The control-specific events for which the closure is called.
-
Associates a closure with the control for the
.touchUpInside
control event.Declaration
Swift
open var actionClosure: ((AnyObject) -> Void)?
-
The control-specific events for which a closure has been associated.
Declaration
Swift
fileprivate(set) open var registeredControlEvents: UIControlEvents?
-
The insets to add to the touch target.
Declaration
Swift
open var touchAreaInsets = UIEdgeInsets.zero