How can I make a countdown with NSTimer?

后端 未结 15 1653
遇见更好的自我
遇见更好的自我 2020-11-30 03:17

How can I make a countdown with an NSTimer using Swift?

15条回答
  •  既然无缘
    2020-11-30 03:55

    Swift 4

    Timer.scheduledTimer(timeInterval: 1.0, target: self, selector: #selector(self.updateTime), userInfo: nil, repeats: true)
    

    Update function

    @objc func updateTime(){
        debugPrint("jalan")
    }
    

提交回复
热议问题