Создал функцию которая отображает новый ViewController вот так:
let newVC = UIStoryboard.init(name: name, bundle: nil).instantiateViewController(withIdentifier: id) as? VCProtocol
currentVC?.present(newVC! as! UIViewController,animated: true, completion: nil)
Но с таким написанием VC не деинициализируется. deinit не вызывается. Как выгрузить из памяти не нужный контроллер?