Reputation: 21091
I have some buttons in my app interface that act like this
let storyBoard : UIStoryboard = UIStoryboard(name: "Main", bundle:nil)
let nextVC = storyBoard.instantiateViewControllerWithIdentifier("customVC") as! customVC
self.presentViewController(nextVC, animated:true, completion:nil)
When user presses them - the new ViewController is shown and everything is ok except one thing - I think that previous ViewController is still in memory. How can i clear it?
Upvotes: 2
Views: 713
Reputation: 1935
To avoid jump in animations I use this code:
self.setViewControllers([New_View_Controller_Class()], animated: true)
Upvotes: 0
Reputation: 27438
try this,
self.presentViewController(vc, animated: true, completion: {() -> Void in
self.dismissViewControllerAnimated(false, completion: { _ in })
Hope this will help :)
Upvotes: 1