Q:

Anyone know whether there is a 5-star rating component on iPhone?

In Google groups and some other web sites, there is a 5-star rating component which is pretty neat, such as in this url:
http://groups.google.com/group/Google-Picasa-Data-API/browse_thread/thread/b5a346e6429a70a7?hl=en
I am wondering whether there is an existing 5-star rating component in the iPhone environment. Or if there is not, if anyone has clue where to start?
Thanks

A:

Here's another open source solution: https://github.com/dlinsin/DLStarRating 

A:

UIView that allows you to build Rating components to provide the same kind of experience AppStore or Youtube applications on iPhone do.
http://code.google.com/p/s7ratingview/

A:

I'd go simpler. Subclass UIControl and implement the touchesBegan: touchesMoved: and touchesEnded: methods. You can determine which star the user pressed/dragged/let up on with the X coordinate of the touch. For example:
CGFloat relativeTouchLocation = [event locationInView:self] / self.bounds.size.width;

Then it's just up to you to determine which stars are illuminated based on that value. Oh, and to send a UIControlEventValueChanged event.
Obviously, you also override drawRect: to draw the stars in the view.
Although Jason's solution above will work, your user won't be able to slide her finger across the control to fine-tune her rating. This would also give you the option of doing half-stars or other fine adjustments.

