Im trying to use a segue to pass through some userInput from a custom alert but for some reason when i preform the segue the view on the app doesn’t change. But the viewdidload on the destination viewcontroller runs, I know this beacuse i put a print statment inside it.
Im useing Xcode Version 15.4
on storyboard
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if segue.identifier == "addWorkout"{
if let destinationVC = segue.destination as? STAddExerciseViewController {
destinationVC.workoutName = customAlert.userInput
print("preformed Seguea to (destinationVC) WorkoutViewController")
}
else{
print("DestinationVC not set")
}
}else{
print("Couldn't find segue identifier")
}
I’ve already checked the segue identifer. The code should preform the segue and present the next viewController
Samuel Mensah is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.