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\
The way I do it is to use both
view.dismiss(animated: true, completion: nil)
and
presentingViewController?.presentingViewController?.dismiss(animated: true, completion: nil)
depend on how many view controllers before. Because they are all optional, Xcode will not complain if you don't have them when you are trying to dismiss. If that is the case, the single dismiss() function will work just fine.
I guess it is because I didn't have a good design in the first place, it works but I don't think you will run into this if you have a good structure in the first place.