I\'m trying to dismiss a VC and present a new VC. but I don\'t want old VC to exist anymore. I use the code below to dismiss current VC and present new one. but this way, there\
If you want to present VC B from VC A and want to dismiss VC A while Presenting, you can use this code:
You write this code in your VC A from which Button you want to present the VC B.
let parentVC = presentingViewController
dismiss(animated: true) {
let vc = self.storyboard!.instantiateViewController(withIdentifier...)
parentVC.present(vc, animated: true)`enter code here`
}