In my viewController I have an NSFetchedResultsController
for populating a tableView
. In the viewDidLoad()
I\'m saving the current time to
I'm leaving the view in a seperate function like this:
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let controller = storyboard.instantiateViewController(withIdentifier: "HomePage") as? HomeVC
controller?.managedObjectContext = self.managedObjectContext
self.present(controller!, animated: true, completion: nil)
Yup, that's the problem. Instead of returning to the existing HomeVC, you're making a new HomeVC and presenting that on top of yourself. So you just keep piling up the view controllers.
What you need to do to get back home is unwind what you did to get here. If present
, now dismiss
. If push
, now pop
.