Skip to content
[INACTIVE] iOS star rating component
Objective-C Ruby CoffeeScript
Branch: master
Clone or download
dlinsin Merge pull request #19 from smartlogic/set-stars-on-init
set custom star images on all stars
Latest commit 21eb281 Jul 29, 2012
Type Name Latest commit message Commit time
Failed to load latest commit information.
DLStarRating fix typo Jul 24, 2012
DLStarRatingDemo no not retain delegate Jun 18, 2012
features Added UI testing with zucchini Jan 2, 2012
.gitignore * new license Aug 30, 2011
DLStarRating.png adopted description Feb 12, 2012
DLStarRating.podspec updated podspec Jul 14, 2012
README.mdown Added description for fractional images #9 Mar 18, 2012



A UIControl subclass that behaves similarly as the App Store rating control.

Written by David Linsin, January 2011.


You find all the sources include two sample images under DLStarRating. Add the source folder to your project and use the DLStarRatingControl in Interface Builder to setup a default 5 star rating control.

If you'd like to instantiate it yourself with a custom number of stars use:

// setup a control with 3 fractional stars at a size of 320x230
DLStarRatingControl *ratingControl = [[DLStarRatingControl alloc] initWithFrame:CGRectMake(0, 0, 320, 230) andStars:3 isFractional:YES];

You can set a default value by setting ratingControl.rating=2.5 and hook up a DLStarRatingDelegate to get notified when the user has changed the rating. Note: if you want to use fractional stars, you have to provide images with width divisible by 10.

To customize the stars, simply replace star.png/star@2x.png and star_highlighted.png/star_highlighted@2x.png under images.

DLStarView.h lets you customize the area below the stars, detecting touches. Simply change the value of kEdgeInsetBottom to increase the area or make it smaller, in case you have other user interface components below. The default is 20px, which allows to select/deselect the stars, while still being able to see them above your finger.

DLStarRating should work with iOS 3.0+, but it has not been tested yet.


You can open the DLStarRating demo project in XCode and run it on your iPhone as well as in the Simulator. There's a DLStarRatingControl hooked up in DLStarRatingDemo.xib, as well as in DLStarRatingDemoViewController. It also shows how to set a rating value and use DLStarRatingDelegate.

Issues and Feature Requests

Please report issues via GitHub's issue tracker.


There's an ARC branch which you can use if your App uses the latest&greatest. It'll sooner or later find it's way into master.

UI Testing

The folder features contains the testing setup needed to run UI tests with zucchini.


DLStarRating is licensed under the Eclipse Public License.

You can’t perform that action at this time.