The nearest ancestor in the view controller hierarchy that is a navigation controller.
SDKs
- iOS 2.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
Framework
- UIKit
Declaration
var navigationController: UINavigation Controller? { get }
Discussion
If the view controller or one of its ancestors is a child of a navigation controller, this property contains the owning navigation controller. This property is nil
if the view controller is not embedded inside a navigation controller.