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 BPKDividedCard with padded initially set.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithPadded:(BOOL)padded;

    Swift

    convenience init(padded: Bool)

    Parameters

    padded

    Whether the card should have padding or not.

  • Create a BPKDividedCard with 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

    primarySubview

    The primary subview for the divided card.

    secondarySubview

    The secondary subview for the divided card.

    padded

    Whether the card should have padding or not.

  • Create a BPKDividedCard with 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

    primarySubview

    The primary subview for the divided card.

    secondarySubview

    The secondary subview for the divided card.

    padded

    Whether the card should have padding or not.

    cornerStyle

    The style of the corners that should be applied to the card.

  • Create a BPKDividedCard with a given frame.

    Declaration

    Objective-C

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

    Swift

    init(frame: CGRect)

    Parameters

    frame

    The initial frame of the card.

    Return Value

    BPKDividedCard instance.

  • Creates a BPKDividedCard 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

    BPKDividedCard instance.

  • 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

    primarySubview

    The primary subview for the divided card. Leading or top depending on orientation.

    secondarySubview

    The secondary subview for the divided card. Trailing or bottom depending on orientation.