UIViewController

Undocumented

  • Convenience method for handling nested UIViewControllers in a UISplitViewController or other situation where a navigation controller may be passed, not the specific UIViewController subclass that contains the ‘content’.

    Declaration

    Swift

    public func navigationRootViewController() -> UIViewController?

    Return Value

    The root UIViewController if self is a UINavigationController or self if not.

  • Convenience method for handling nested UIViewControllers in a UISplitViewController or other situation where a navigation controller may be passed, not the specific UIViewController subclass that contains the ‘content’.

    Declaration

    Swift

    public func navigationTopViewController() -> UIViewController?

    Return Value

    The top most UIViewController in the stack if self is a UINavigationController or self if not.

  • Convenience method for presenting a UIViewController configuring the popoverPresentationController to use a given UIView or UIBarButtonItem. This is useful for action sheets and UIActivityViewControllers.

    • paramter inViewController: The UIViewController that will present the UIAlertController. If nil, self is used to present the UIAlertController. The default value is nil.

    -seealso: openInSafari(_:)

    Declaration

    Swift

    public func presentViewController(vc:UIViewController, fromSourceItem item: UIPopoverSourceType, inViewController:UIViewController? = nil, animated:Bool = true, completion: (() -> ())? = nil)

    Parameters

    vc

    The UIViewController to present.

    item

    Either the UIView or UIBarButtonItem that the ActionSheet style UIAlertController will be presented from on Regular-Regular size class devices.

    animated

    Passed to presentViewController(_:animated:completion:)

    completion

    Passed to presentViewController(_:animated:completion:)