Skip to content

Repository files navigation

SRatingView

SRatingView simplifies rating visulatisation via a simple UIView subclass. It allows you to display any rating value easily, even with animation!

Sample

Requirements

  • iOS 6.0 or higher
  • Requires ARC

Installation

The easiest way to use SRatingView in your app is via CocoaPods.

  1. Add the following line in the project's Podfile file: pod 'SRatingView'
  2. Run the command pod install from the Podfile folder directory.

Usage

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:

Fill Image Empty Image

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:

Result

Notes

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.

License

Distributed under the permissive zlib license. See the LICENSE file for more info.

Contact

Selim Bakdemir

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages