Closed lsamaria closed 4 years ago
Please consider submitting the following information (if relevant):
How do I change the totalStars property? When I try I get an error that says:
totalStars
When I look inside the pod inside the CosmosDefaultSettings file it's a constant:
CosmosDefaultSettings
constant
/// The total number of stars to be shown. static let totalStars = 5
I tried changing it to 10 there but it still only showed 5 stars after I ran the project.
Programmatic code, I don't use storyboard:
lazy var starRating: CosmosView = { let cosmosView = CosmosView() cosmosView.translatesAutoresizingMaskIntoConstraints = false cosmosView.rating = 0.0 cosmosView.settings.starSize = 22.5 cosmosView.settings.fillMode = .precise cosmosView.settings.minTouchRating = 0.0 cosmosView.totalStars = 10 // *** DOESN'T WORK *** return cosmosView }()
I found it, I had to use access it through the settings property first:
settings
cosmosView.settings.totalStars = 10
Please consider submitting the following information (if relevant):
How do I change the
totalStars
property? When I try I get an error that says:When I look inside the pod inside the
CosmosDefaultSettings
file it's aconstant
:I tried changing it to 10 there but it still only showed 5 stars after I ran the project.
Programmatic code, I don't use storyboard: