UIViewController

public extension UIViewController
  • Previous view controller in navigation stack

    Declaration

    Swift

    var previous: UIViewController? { get }
  • Goes down presentation chain and returns root view controller that presents whole chain.

    Declaration

    Swift

    var rootPresentingViewController: UIViewController? { get }
  • Try to get window that owns this view controller.

    Declaration

    Swift

    var window: UIWindow? { get }
  • Returns true if controller curently is pushing, presenting, poping or dismissing.

    Declaration

    Swift

    var isBeingTransitioned: Bool { get }
  • Returns true if controller curently is pushing or presenting.

    Declaration

    Swift

    var isBeingAdded: Bool { get }
  • Returns true if controller curently is poping or dismissing.

    Declaration

    Swift

    var isBeingRemoved: Bool { get }
  • Presents view controller animated

    Declaration

    Swift

    func present(_ vc: UIViewController)

Remove

  • Remove view controller animated action. Removes using pop if it was pushed or using dismiss if it was presented.

    Declaration

    Swift

    @IBAction
    open func remove(sender: Any)
  • Removes view controller using pop if it was pushed or using dismiss if it was presented. Removes also overlaying controllers if needed.

    Declaration

    Swift

    public func remove(animated: Bool, completion: (() -> Swift.Void)? = nil)
  • Removes all presented view controllers and navigates to the root.

    Declaration

    Swift

    public func removeToRoot(animated: Bool, completion: (() -> Swift.Void)? = nil)
  • End editing in viewController’s view

    Declaration

    Swift

    @IBAction
    open func endEditing(_ sender: Any)

Other

  • Returns navigation controller with self as root.

    Declaration

    Swift

    var wrappedIntoNavigation: UINavigationController { get }