BPKDialogController

@interface BPKDialogController
    : UIViewController <BPKDialogViewDelegate,
                        UIViewControllerTransitioningDelegate>

A UIViewController subclass encapsulating the Backpack dialog component. The controller is preconfigured to use itself as the transitioningDelegate consumers should not change this as it breaks the custom transition support. The dialog always contains a title and message as-well as zero or more action buttons. The scrim display behind the content view can be configured to dismiss the view controller where appropriate.

The controller is exclusively intended to be used with presentViewController:.

  • The style of the dialog.

    Declaration

    Objective-C

    @property (nonatomic) BPKDialogControllerStyle style;

    Swift

    var style: BPKDialogControllerStyle { get set }
  • Add a button action to the dialog. For both styles the buttons actions are display in the order they are added after the title and message.

    Declaration

    Objective-C

    - (void)addButtonAction:(nonnull BPKDialogButtonAction *)action;

    Swift

    func addButtonAction(_ action: BPKDialogButtonAction)

    Parameters

    action

    The action to add

  • The scrim tap action for the dailog. This action is invoked whenever the scrim is tapped, if shouldDismiss is YES/true the controller is immediately dismissed after calling the handler.

    See

    BPKDialogScrimAction

    Declaration

    Objective-C

    @property (nonatomic, strong, nullable) BPKDialogScrimAction *scrimAction;

    Swift

    var scrimAction: BPKDialogScrimAction? { get set }
  • The style of the corners of the Dialog.

    See

    BPKDialogCornerStyle

    Declaration

    Objective-C

    @property (nonatomic) BPKDialogCornerStyle cornerStyle;

    Swift

    var cornerStyle: BPKDialogCornerStyle { get set }
  • The size of the buttons. By default this is BPKButtonSizeLarge.

    Declaration

    Objective-C

    @property (nonatomic) BPKButtonSize buttonSize;

    Swift

    var buttonSize: Int32 { get set }
  • Create an instance of the controller.

    Declaration

    Objective-C

    + (nonnull instancetype)
        dialogControllerWithTitle:(NSString *_Nullable)title
                          message:(nonnull NSString *)message
                            style:(BPKDialogControllerStyle)style
                   iconDefinition:
                       (BPKDialogIconDefinition *_Nullable)iconDefinition;

    Swift

    convenience init(title: String?, message: String, style: BPKDialogControllerStyle, iconDefinition: BPKDialogIconDefinition?)

    Parameters

    title

    The tile to display in the dialog.

    message

    The message to display in the body of the dialog.

    style

    The style of the dialog.

    iconDefinition

    the icon specification to show at the top of the dialog.

  • Create an instance of the controller.

    Declaration

    Objective-C

    + (nonnull instancetype)
        dialogControllerWithTitle:(NSString *_Nullable)title
                          message:(nonnull NSString *)message
                            style:(BPKDialogControllerStyle)style
                   iconDefinition:(BPKDialogIconDefinition *_Nullable)iconDefinition
                        flareView:(id)flareView;

    Swift

    convenience init(title: String?, message: String, style: BPKDialogControllerStyle, iconDefinition: BPKDialogIconDefinition?, flareView: Any!)

    Parameters

    title

    The tile to display in the dialog.

    message

    The message to display in the body of the dialog.

    style

    The style of the dialog.

    iconDefinition

    the icon specification to show at the top of the dialog.

    flareView

    the BPKFlareView to show at the top of the dialog.

  • Used internally for animation, not intended for public use.

    Declaration

    Objective-C

    - (void)_setScrimAlpha:(double)scrimAlpha;

    Swift

    func _setScrimAlpha(_ scrimAlpha: Double)
  • Used internally for animation, not intended for public use.

    Declaration

    Objective-C

    - (void)_addPresentingKeyFrameContentAnimationWithRelativeStartTime:
                (double)startTime
                                                       relativeDuration:
                                                           (double)duration;

    Swift

    func _addPresentingKeyFrameContentAnimation(withRelativeStartTime startTime: Double, relativeDuration duration: Double)
  • Used internally for animation, not intended for public use.

    Declaration

    Objective-C

    - (void)_addDismissingKeyFrameContentAnimationWithRelativeStartTime:
                (double)startTime
                                                       relativeDuration:
                                                           (double)duration;

    Swift

    func _addDismissingKeyFrameContentAnimation(withRelativeStartTime startTime: Double, relativeDuration duration: Double)