BPKSnackbarButton

@interface BPKSnackbarButton : NSObject

Describes the button to show in a snackbar.

  • The optional visible title that will be displayed.

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly, nullable) NSString *title;

    Swift

    var title: String? { get }
  • The optional icon that will be displayed

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly, nullable) UIImage *icon;

    Swift

    var icon: UnsafeMutablePointer<Int32>? { get }
  • The accessibility label that VoiceOver will read out for the button.

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly, nullable) NSString *accessibilityLabel;

    Swift

    var accessibilityLabel: String? { get }
  • Whether the receiver will display an icon only button or not.

    Declaration

    Objective-C

    @property (nonatomic, readonly, getter=isIconOnly) BOOL iconOnly;

    Swift

    var isIconOnly: Bool { get }
  • A button with only a textual title.

    Declaration

    Objective-C

    + (nonnull instancetype)buttonWithTitle:(nonnull NSString *)title;

    Swift

    convenience init(title: String)

    Parameters

    title

    The title to use.

    Return Value

    An instance that will display a text only button.

  • An icon only button with an accesssibility label for Voice Over.

    Declaration

    Objective-C

    + (nonnull instancetype)buttonWithIcon:(nonnull UIImage *)icon
                        accessibilityLabel:(nonnull NSString *)accessibilityLabel;

    Swift

    convenience init(icon: Any!, accessibilityLabel: String)

    Parameters

    icon

    The icon to use.

    accessibilityLabel

    The accessibiltiy label read out by VoiceOver.

    Return Value

    An instance that will display a icon only button and be read out with VoiceOver.

  • A button with an visible text with a specific accessibilityLabel. Normally the accessibilityLabel would be derived from the title but in this it’s set explicitly. This is useful when you want to provide different text to sighted user and VoiceOver users.

    Declaration

    Objective-C

    + (nonnull instancetype)buttonWithTitle:(nonnull NSString *)title
                         accessibilityLabel:(nonnull NSString *)accessibilityLabel;

    Swift

    convenience init(title: String, accessibilityLabel: String)

    Parameters

    title

    The visual title to u.se

    accessibilityLabel

    The accessibility label read out by VoiceOver.

    Return Value

    An instance that will display a text button with a custom label for VoiceOver.