views:

82

answers:

2

I have a requirement for a UIView that displays stars similar to the way one can rate albums in iTunes on the Mac and iPhone.

Does anyone know what it would involve to create this or whether one is available online?

+1  A: 

Have a look at the TouchCustoms library. I'm pretty sure there's a star rating component for iOS in there.

Jacob Relkin
Hi there - am trying to clone the repository in order to use it - get this error message: MyName-MacBook-Pro:Untitled myname$ aleks$ git clone [email protected]:eisernWolf/TouchCustoms.git-bash: aleks$: command not found
TheLearner
@TheLearner You need to have git installed on your local machine in order to do that. Just download the source from the GitHub URL I referred you to.
Jacob Relkin
@Jacob did you manage to get the sample project building? Undefined symbols: "_OBJC_METACLASS_$_SCRatingView", referenced from: _OBJC_METACLASS_$_RatingCellView in RatingCellView.o "_OBJC_CLASS_$_SCRatingView", referenced from: _OBJC_CLASS_$_RatingCellView in RatingCellView.old: symbol(s) not foundcollect2: ld returned 1 exit status
TheLearner
@Jacob - thanks for the link but I am a bit of a amateur - didn't manage to get it working
TheLearner
A: 

I had it done it a couple of months back. It is very simple.

  • Subclass a UIView.
  • Add the 5 stars(UIImageviews)
  • Write a function to toggle the image of the stars
  • In the touches Began and touches moved method Check for the touch and accordingly change the images of the imageviews.
  • Also add a int variable that will have the current rating.(you can set the value whenever the toggle changes the images of the stars)
BK
jus try it out, its easy.. Incase u need some help I might have the code lying around;)
BK