BPKRating

@interface BPKRating : UIView

BPKRating is a subclass of UIView configured with Skyscanner style properties.

  • The title to display inside the rating.

    Declaration

    Objective-C

    @property (nonatomic, strong) BPKRatingTextDefinition *_Nonnull title;

    Swift

    var title: BPKRatingTextDefinition { get set }
  • The subtitle to display inside the rating.

    Declaration

    Objective-C

    @property (nonatomic, strong, nullable) BPKRatingTextDefinition *subtitle;

    Swift

    var subtitle: BPKRatingTextDefinition? { get set }
  • Size of the rating

    See

    BPKRatingSize

    Declaration

    Objective-C

    @property (nonatomic) BPKRatingSize size;

    Swift

    var size: BPKRatingSize { get set }
  • Layout of the rating

    See

    BPKRatingLayout

    Declaration

    Objective-C

    @property (nonatomic) BPKRatingLayout layout;

    Swift

    var layout: BPKRatingLayout { get set }
  • The rating value

    Declaration

    Objective-C

    @property (nonatomic) double ratingValue;

    Swift

    var ratingValue: Double { get set }
  • Creates a BPKRating 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

    BPKRating instance.

  • Create a BPKRating with a given frame.

    Declaration

    Objective-C

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

    Swift

    init(frame: CGRect)

    Parameters

    frame

    The initial frame of the rating.

    Return Value

    BPKRating instance.

  • Create a BPKRating with a given rating value and title.

    Declaration

    Objective-C

    - (nonnull instancetype)
        initWithRatingValue:(CGFloat)ratingValue
                      title:(nonnull BPKRatingTextDefinition *)title
                   subtitle:(BPKRatingTextDefinition *_Nullable)subtitle;

    Swift

    init(ratingValue: CGFloat, title: BPKRatingTextDefinition, subtitle: BPKRatingTextDefinition?)

    Parameters

    ratingValue

    The value shown in the rating component

    title

    The title of the rating

    subtitle

    The subtitle of the rating

    Return Value

    BPKRating instance.