I'm trying to pass a number from a label to a timer.
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))
}
I get a "found nil" error. Below is how I initialize the seconds variable.
var seconds: Int = 0