SRatingView simplifies rating visulatisation via a simple UIView subclass. It allows you to display any rating value easily, even with animation!
- iOS 6.0 or higher
- Requires ARC
The easiest way to use SRatingView in your app is via CocoaPods.
- Add the following line in the project's Podfile file:
pod 'SRatingView'
- Run the command
pod install
from the Podfile folder directory.
SRatingView requires an initial setup to display the rate value correctly. It assumes that you have both a filled and an empty rating image. For the example project i use these images:
First we will assign these images accordingly:
self.ratingView.ratingFillTileImage = [UIImage imageNamed:@"rating-star"];
self.ratingView.ratingEmptyTileImage = [UIImage imageNamed:@"rating-star-empty"];
The configuration requires how many tiles of these images will be used:
[self.ratingView setNumberOfTiles:5];
The only thing left is to display the actual rate value:
[self.ratingView setRateValue:0.3 animated:YES];
Result is here:
For next version, i plan to add action to SRatingView,to make the user able to rate anything. Action will support both float and integer type of values.
Distributed under the permissive zlib license. See the LICENSE file for more info.
Selim Bakdemir