BPKButton
@interface BPKButton : UIButton
BPKButton
is a subclass of UIButton
configured with Skyscanner style properties.
-
The title displayed by the button.
Declaration
Objective-C
@property (nonatomic, copy, nullable) NSString *title;
Swift
var title: String? { get set }
-
Sets the image displayed by the receiver.
Declaration
Objective-C
- (void)setImage:(UIImage *_Nullable)image;
Swift
func setImage(_ image: UIImage?)
Parameters
image
The image to display. If
nil
the image is removed. -
Creates a
BPKButton
with a specific size and style.See
BPKButtonSizeSee
BPKButtonStyleDeclaration
Objective-C
- (nonnull instancetype)initWithSize:(BPKButtonSize)size style:(BPKButtonStyle)style;
Swift
init(size: BPKButtonSize, style: BPKButtonStyle)
Parameters
size
Size to be used by the button.
style
Style of the button.
Return Value
BPKButton
instance. -
Creates a
BPKButton
with a decoder (typically when creating from Storyboards)Declaration
Objective-C
- (nullable instancetype)initWithCoder:(nonnull NSCoder *)aDecoder;
Swift
init?(coder aDecoder: NSCoder)
Parameters
aDecoder
Decoder object to extract parameters from
Return Value
BPKButton
instance. -
Create a
BPKButton
with a given frame.Declaration
Objective-C
- (nonnull instancetype)initWithFrame:(CGRect)frame;
Swift
init(frame: CGRect)
Parameters
frame
The initial frame of the button.
Return Value
BPKButton
instance. -
Size of the button
See
BPKButtonSizeDeclaration
Objective-C
@property (nonatomic) BPKButtonSize size;
Swift
var size: BPKButtonSize { get set }
-
Style of the button
See
BPKButtonStyleDeclaration
Objective-C
@property (nonatomic) BPKButtonStyle style;
Swift
var style: BPKButtonStyle { get set }
-
Position of the image in the button. This has no effect for icon only buttons.
See
BPKButtonImagePositionDeclaration
Objective-C
@property (nonatomic) BPKButtonImagePosition imagePosition;
Swift
var imagePosition: BPKButtonImagePosition { get set }
-
Setting this property to YES will change the button state. Loading state will disable the button.
Declaration
Objective-C
@property (nonatomic) BOOL isLoading;
Swift
var isLoading: Bool { get set }