0

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?

Jacob Relkin
  • 161,348
  • 33
  • 346
  • 320
TheLearner
  • 19,387
  • 35
  • 95
  • 163
  • 1
    possible duplicate of [Anyone know whether there is a 5-star rating component on iPhone?](http://stackoverflow.com/questions/292137/anyone-know-whether-there-is-a-5-star-rating-component-on-iphone) – Brad Larson Sep 27 '10 at 18:21
  • 1
    See also http://stackoverflow.com/questions/2198945/want-to-display-and-implement-rating-as-in-ipod-app and http://stackoverflow.com/questions/2500980/how-to-add-star-rating-to-uitableview-cell – Brad Larson Sep 27 '10 at 18:21

2 Answers2

2

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

Jacob Relkin
  • 161,348
  • 33
  • 346
  • 320
  • 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 git@github.com:eisernWolf/TouchCustoms.git -bash: aleks$: command not found – TheLearner Sep 27 '10 at 10:58
  • @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 Sep 27 '10 at 11:08
  • 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.o ld: symbol(s) not found collect2: ld returned 1 exit status – TheLearner Sep 27 '10 at 13:34
  • thanks for the link but I am a bit of a amateur - didn't manage to get it working – TheLearner Sep 27 '10 at 14:31
1

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)
B K
  • 1,554
  • 3
  • 19
  • 40
  • jus try it out, its easy.. Incase u need some help I might have the code lying around;) – B K Sep 27 '10 at 12:58