Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var timer = Timer()
- var time = 210
- func decreasetimer() {
- if time > 0 {
- time -= 1
- timerlabel.text = String(time)
- * }else{
- timerlabel.text = String(time)
- }
- }
- @IBOutlet var timerlabel: UILabel!
- @IBAction func timerstarter(_ sender: AnyObject) {
- timer = Timer.scheduledTimer(timeInterval: 1, target: self, selector: #selector(ViewController.processtimer), userInfo: nil, repeats: true)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement