BPKDividedCard
@interface BPKDividedCard : BPKCard
BPKDividedCard is a subclass of BPKCard which contains the Skyscanner divided card style.
Divided cards are a lightweight containers with a subtle shadow and two subviews.
Divided cards, like Cards, can be configured to have padding or not.
-
The orientation of the divided card.
Declaration
Objective-C
@property (nonatomic) UILayoutConstraintAxis orientation;Swift
var orientation: NSLayoutConstraint.Axis { get set } -
The primary subview within the divided card. This is the leading view when the orientation is horizontal and the top view when the orientation is vertical.
Declaration
Objective-C
@property (nonatomic, nullable) UIView *primarySubview;Swift
unowned(unsafe) var primarySubview: UIView? { get set } -
The secondary subview within the divided card. This is the trailing view when the orientation is horizontal and the bottom view when the orientation is vertical.
Declaration
Objective-C
@property (nonatomic, nullable) UIView *secondarySubview;Swift
unowned(unsafe) var secondarySubview: UIView? { get set } -
Create a
BPKDividedCardwith padded initially set.Declaration
Objective-C
- (nonnull instancetype)initWithPadded:(BOOL)padded;Swift
convenience init(padded: Bool)Parameters
paddedWhether the card should have padding or not.
-
Create a
BPKDividedCardwith two subviews.Declaration
Objective-C
- (nonnull instancetype)initWithPrimarySubview:(UIView *_Nullable)primarySubview secondarySubview: (UIView *_Nullable)secondarySubview padded:(BOOL)padded;Swift
convenience init(primarySubview: UIView?, secondarySubview: UIView?, padded: Bool)Parameters
primarySubviewThe primary subview for the divided card.
secondarySubviewThe secondary subview for the divided card.
paddedWhether the card should have padding or not.
-
Create a
BPKDividedCardwith two subviews.Declaration
Objective-C
- (nonnull instancetype)initWithPrimarySubview:(UIView *_Nullable)primarySubview secondarySubview: (UIView *_Nullable)secondarySubview padded:(BOOL)padded cornerStyle:(BPKCardCornerStyle)cornerStyle;Swift
init(primarySubview: UIView?, secondarySubview: UIView?, padded: Bool, cornerStyle: BPKCardCornerStyle)Parameters
primarySubviewThe primary subview for the divided card.
secondarySubviewThe secondary subview for the divided card.
paddedWhether the card should have padding or not.
cornerStyleThe style of the corners that should be applied to the card.
-
Create a
BPKDividedCardwith a given frame.Declaration
Objective-C
- (nonnull instancetype)initWithFrame:(CGRect)frame;Swift
init(frame: CGRect)Parameters
frameThe initial frame of the card.
Return Value
BPKDividedCardinstance. -
Creates a
BPKDividedCardwith a decoder (typically when creating from Storyboards)Declaration
Objective-C
- (nullable instancetype)initWithCoder:(nonnull NSCoder *)aDecoder;Swift
init?(coder aDecoder: NSCoder)Parameters
aDecoderDecoder object to extract parameters from
Return Value
BPKDividedCardinstance. -
Set the subviews used in the Divided Card
Declaration
Objective-C
- (void)setPrimarySubview:(nonnull UIView *)primarySubview secondarySubview:(nonnull UIView *)secondarySubview;Swift
func setSubviews(primarySubview: UIView, secondarySubview: UIView)Parameters
primarySubviewThe primary subview for the divided card. Leading or top depending on orientation.
secondarySubviewThe secondary subview for the divided card. Trailing or bottom depending on orientation.
BPKDividedCard Class Reference