我正在尝试将标签中的数字传递给计时器。
override func viewDidLoad() {
super.viewDidLoad()
pauseButton.isEnabled = false
seconds = Int(timerTimeSetting.text!)! //Here is my problem line
if let task = timerTask {
timerTaskName.text = task.task
}
if let timerTimeLeft = timerTime {
timerTimeSetting.text = timerTimeLeft.time
}
self.timerLabel.text = timeString(time: TimeInterval(seconds))
}
我收到“发现无”错误。下面是我初始化秒变量的方法。
var seconds: Int = 0