Suppose I have a navigation controller with root view controller A, and I need to present a view controller B, I can do with either of the following two ways:
self.navigationController!.presentViewController(b, animated: true)
self.presentViewController(b, animated: true)
They are analogous - both initiate a modal presentation.
In recent iOS versions, modal presentation always travels to the top most container view controller. So when your view controller (aka
self) is container inside a navigation controller (aka
self.navigationController), when you attempt presenting on the view controller, it will pass the presentation duties to the navigation controller. You can verify this by logging the
b once the presentation is completed. In both cases,
presentingController will be the navigation controller.