I use performSegueWithIdentifier to navigate between views controllers
I have a tableView with multiple rows, when a row is actioned, i call a webViewController to play selected ressource with segue
performSegueWithIdentifier("Play", sender: nil)
Associate with :
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
if(segue.identifier == "Play") {
let detailVC = segue.destinationViewController as! WebViewController
detailVC.courseToPlay = self.courseToPlay
}
}
And, on WebViewController, i've a button to goBack on the list, whose i want to destroy instance of webViewController on goBack
I've not NavigationController in my storyBoard, so, this line doesn't work
navigationController.popViewControllerAnimated(true)
I use segue again to goBack :
performSegueWithIdentifier("closePlayer", sender: nil)
But each segue action instance a new view controller and they're never really free from memory, they seems to just be hiddens
eg : in Safari debugger i can see a lot of page and i can always interact with these in console
How to properly 'destroy' a view when scene change
Swift3:
self.dismiss(animated: true, completion: nil)
Hope it can help you.
Thanks
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With