ProductReviews

@objc(GFYProductReviews)
public class ProductReviews : NSObject, Encodable

Contains product review and rating information

  • The product rating rounded to two decimal places

    Declaration

    Swift

    public var rating: Decimal? { get }
  • The allowable rating range

    Declaration

    Swift

    public let ratingScale: ClosedRange<Double>?
  • The number of reviews

    Declaration

    Swift

    public let reviewCount: UInt?
  • Creates a ProductReviews instance

    Returns nil if all parameters are nil or if rating is out of range for the provided ratingScale.

    Declaration

    Swift

    public init?(rating: Double?,
                 ratingScale: ClosedRange<Double>?,
                 reviewCount: UInt?)

    Parameters

    rating

    The product rating

    ratingScale

    The allowable rating range

    reviewCount

    The number of reviews

  • Retrieves String representation of ProductReviews

    Declaration

    Swift

    public override var description: String { get }