I\'m trying to create an NSTimer in Swift but I\'m having some trouble.
NSTimer
Swift
NSTimer(timeInterval: 1, target: self, selector: test(), us
Swift 4.0
you create the Selector like below.
1.add the event to a button like:
button.addTarget(self, action: #selector(clickedButton(sender:)), for: UIControlEvents.touchUpInside)
and the function will be like below:
@objc func clickedButton(sender: AnyObject) { }