hsousa / HCSStarRatingView

Simple star rating view for iOS written in Objective-C
MIT License
1.28k stars 196 forks source link

I want Star Rating in read-only mode but also detect touches for displaying an alert #67

Closed AbrahamEP closed 6 years ago

AbrahamEP commented 6 years ago

I need just show the stars and the user can't change them but when the users tap the rating view show an alert. Is that possible ?

hsousa commented 6 years ago

The easiest way to achieve this without having to change how the rating view works internally is through composition: wrap the start rating view inside a custom view that manages the touches (through a gesture recognizer, for example).

That way you can safely disable user interaction on the rating view and still be able to grap a tap to display an alert.

To make updating the rating view's values easier, also implement a property or method in your wrapper view and propagate the result down to the internal rating view.

Hope this helps, closing the issue for now.

AbrahamEP commented 6 years ago

Great! Thank you so much