I am trying to push some data back to the previous view controller ( Let's call this AViewController ) from my current one ( Let's call this BViewController )
however, when I use performSegue method it shows me the AViewController I wanted but makes the tab bar controller at the botton of the screen disappear (iirc this is because it creates a new "view" with the performSegue method?)
but when I use the dismiss method no data is passed back (neither in the completion with self.performSegue)
So how do I push my data back to AViewController while still have my tab bar controller at the bottom?
Here's my code
// Push data to AViewController
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
var aViewController = segue.destination as? AViewController
if routineReps.isEmpty == false {
for i in 0...routineReps.count-1 {
routineViewController?.workOutNameArray.append(routineNames[i])
routineViewController?.workOutSetsArray.append(routineSets[i])
routineViewController?.workOutRepsArray.append(routineReps[i])
}
}
}
// Button Action to push data back to previous viewcontroller
@IBAction func completeAddingWorkoutButton(_ sender: UIButton) {
self.performSegue(withIdentifier: "addWorkoutsForTodaySegue", sender: self)
}