I'm using this code to reload root view controller of navigation controller.
if let newVC = self?.storyboard?.instantiateViewController(withIdentifier: "MyViewController"), let nc = self?.navigationController {
nc.setViewControllers([newVC], animated: true)
}
But I've found that this code yeilds memory leak: memory is not released using this code.
How can catch and fix this? Any suggestions?