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
controlThe
UIControlon which events will trigger thecompletionblock.forControlEventsThe
UIControlEventssent bycontrolthat will triggercompletion.completionThe code that will run when
controlsendsforControlEvents. -
The function that is called from
UIControl.addTarget(_:action:forControlEvents:).Declaration
Swift
public func targetted(sender:AnyObject?)
View on GitHub
ObjectTarget Class Reference