/DJWStarRatingView

A simple, customisable, star rating view.

Primary LanguageObjective-CMIT LicenseMIT

DJWStarRatingView

A view that represents a given rating using stars. Uses custom drawing to allow their appearance at any size. The view also allows for editing, using either tapping, panning, or both.

Demo

Screenshot

Usage

Create a new instance of DJWStarRatingView, utilising the designated initialiser:

- (instancetype)initWithStarSize:(CGSize)starSize
                   numberOfStars:(NSInteger)numberOfStars
                          rating:(float)rating
                       fillColor:(UIColor *)fillColor
                   unfilledColor:(UIColor *)unfilledColor
                     strokeColor:(UIColor *)strokeColor;

rating value's decimal part can either be .0 or .5.

Installation

Simply add DJWStarRatingView to your Podfile if you're using CocoaPods. Alternatively, add DJWStarRatingView.h and DJWStarRatingView.m to your project. Included in this repository is a demo application, showing the project in action.

License

DJWStarRatingView is licensed under the MIT license.