BPKSwitch

@interface BPKSwitch : UISwitch

BPKSwitch is a subclass of UISwitch configured with Skyscanner style properties.

  • Creates a BPKSwitch with a decoder (typically when creating from storyboards)

    Declaration

    Objective-C

    - (nonnull instancetype)initWithCoder:(nonnull NSCoder *)coder;

    Swift

    init(coder: NSCoder)

    Parameters

    coder

    Decoder object to extract parameters from

    Return Value

    BPKSwitch instance.

  • Create a BPKSwitch with a given frame.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithFrame:(CGRect)frame;

    Swift

    init(frame: CGRect)

    Parameters

    frame

    The initial frame of the switch.

    Return Value

    BPKSwitch instance.

  • The primary color of the reciever. This is used to control the onTintColor.

    Warning

    This is not intended to be used directly, it exists to support theming only.

    Declaration

    Objective-C

    @property (nonatomic, strong, nullable) UIColor *primaryColor;

    Swift

    var primaryColor: UIColor? { get set }