I have a segue that starts once a timer hits 00:00. The segue was created on the storyboard. Once it starts it goes to the next view with 4 different variables that are supposed to transfer but for some reason the variables all transfer as nil. The variables shouldn't be nil. minutesTotal comes from a slider, startValue and startFraction both come from pickers and current tank comes from another picker.
This is the code where the segue is performed.
@objc func updateTimer(){
if seconds < 1 {
timer.invalidate()
isTimerRunning = false
performSegue(withIdentifier: "timeToFinal", sender: self)
} else {
seconds -= 1
timeLabel.text = timeString(time: TimeInterval(seconds))
}
this is where i override the prepareSegue function
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if segue.identifier == "timeToFinal"{
if let finalFlowViewController = segue.destination as? FinalFlowViewController{
finalFlowViewController.currentTank = currentTank
finalFlowViewController.startFraction = startFraction
finalFlowViewController.startValue = startValue
finalFlowViewController.time = minutesTotal
}
}
}
Both of these come from ViewController.