CreationKit Documentation

Class Ratings

public final class Ratings: UIView  

Ratings provide insight regarding others’ opinions and experiences with providers and facilities.

Ratings is a horizontal stack containing five colored stars based on the average ratings passed

It takes three Double's as parameters : average, ratings, reviews

average is responsible for displaying the right amount of stars. Ratings will round this parameter to its nearest half. Example: 3.2 becomes 3.0, or 3.4 becomes 3.5, and display the stars accordingly. The average text displayed will also be affected by this.

For ratings values > 999, Ratings will automatically display its abbreviated expression: "1k ratings"

Same applies for reviews "10k reviews"

Ratings Ratings UIView UIView Ratings->UIView

Conforms To

UIView

Initializers

init(average:​ratings:​reviews:​)

public init(average: Double, ratings: Double, reviews: Double)  

Creates a new Ratings.

Prefer to use the make factory method over this one.

Parameters

average Double

The rating average (e.g. 3.5)

ratings Double

The number of ratings

reviews Double

The number of reviews

Methods

make(average:​ratings:​reviews:​)

public static func make(average: Double, ratings: Double, reviews: Double) -> Ratings  

Creates a new Ratings.

Parameters

average Double

The rating average (e.g. 3.5)

ratings Double

The number of ratings

reviews Double

The number of reviews