Present

public protocol Present: class

Declare a method to present alert to the view controller.

  • Present the alert on a given view controller.

    Declaration

    Swift

    func present(in vc: UIViewController, animated flag: Bool, completion: (() -> Void)?)

    Parameters

    vc

    The view controller.

    flag

    Pass true to animate the presentation; otherwise, pass false.

    completion

    The block to execute after the presentation finishes.

  • Present the alert on a given view controller. The completion block is nil.

    Declaration

    Swift

    func present(in vc: UIViewController, animated flag: Bool)

    Parameters

    vc

    The view controller.

    flag

    Pass true to animate the presentation; otherwise, pass false.

  • Present the alert on a given view controller. The animated flag is true, and the completion block is nil.

    Declaration

    Swift

    func present(in vc: UIViewController)

    Parameters

    vc

    The view controller.