ObjectTarget
public class ObjectTarget<T:UIControl>:NSObject
A class for handling UIControl.addTarget(_:action:forControlEvents:)
in a pure swift class.
-
The control which will trigger the completion on the given control events.
Declaration
Swift
public let control:UIControl
-
The completion box that will run for the given control events.
Declaration
Swift
public let completion:(sender:T) -> ()
-
Default initialiser.
Declaration
Swift
public init(control:T, forControlEvents:UIControlEvents, completion:(sender:T) -> ())
Parameters
control
The
UIControl
on which events will trigger thecompletion
block.forControlEvents
The
UIControlEvents
sent bycontrol
that will triggercompletion
.completion
The code that will run when
control
sendsforControlEvents
. -
The function that is called from
UIControl.addTarget(_:action:forControlEvents:)
.Declaration
Swift
public func targetted(sender:AnyObject?)