YMARatingAppearance

Objective-C

@interface YMARatingAppearance : NSObject <NSCopying, NSMutableCopying>

Swift

class YMARatingAppearance : NSObject, NSCopying, NSMutableCopying

A class with fixed settings for the standard rating appearance. If you want to edit the standard appearance settings, use the YMAMutableRatingAppearance class.

  1. Properties
  2. emptyStarColor
  3. filledStarColor
  4. preferredStarSize
  5. Methods
  6. +appearanceWithEmptyStarColor:filledStarColor:starSize:

Properties

emptyStarColor

The outline color of an empty (unfilled) star.

Declaration

Objective-C

@property (nonatomic, strong, readonly) UIColor *_Nonnull emptyStarColor;

filledStarColor

The color of a filled star.

Declaration

Objective-C

@property (nonatomic, strong, readonly) UIColor *_Nonnull filledStarColor;

preferredStarSize

The preferred size of a star.

Note If the use of the preferred size makes the rating too large for the space reserved for it, the maximum allowed size is used instead.

Declaration

Objective-C

@property (nonatomic, readonly) CGFloat preferredStarSize;

Swift

var preferredStarSize: CGFloat { get }

Methods

+appearanceWithEmptyStarColor:filledStarColor:starSize:

Creates an object of the YMARatingAppearance class, that is, a rating with the specified appearance (outline color, size, and other settings).

Declaration

Objective-C

+ (nonnull instancetype)
    appearanceWithEmptyStarColor:(nonnull UIColor *)emptyStarColor
                 filledStarColor:(nonnull UIColor *)filledStarColor
                        starSize:(CGFloat)starSize;

Swift

convenience init(emptyStarColor: Any!, filledStarColor: Any!, starSize: CGFloat)

Parameters

emptyStarColor

The outline color of an empty (unfilled) star.

filledStarColor

The color of a filled star.

starSize

The preferred size of a star.

emptyStarColor

The outline color of an empty (unfilled) star.

filledStarColor

The color of a filled star.

starSize

The preferred size of a star.

Return Value

Configured rating appearance.