Code Monkey home page Code Monkey logo

hcsstarratingview's Issues

Refactor names to remove 'star' reference

Related to #18, doesn't really make sense to keep having 'star' in the name.

Might be a good idea to take the opportunity to rename/re-organize some properties as well, since version 2.0 will include major changes.

Left and right stars cropped

After setting HCSStarRatingView width small then 100px first and last starts are cropped.
See attached screenshot.
screen shot 2015-10-01 at 7 08 57 pm

Delegate

Could you please add a delegate? I would like to be notified about value changes similarly to other UIControl classes. I think about something similar as:

- (void)starRatingView:(HCSStarRatingView *)starRatingView didChangeValueTo:(CGFloat)value;

Interface Designer does not render the view

It throws the following error:

Main.storyboard: error: IB Designables: Failed to render instance of HCSStarRatingView: Failed to load designables from path (null)

I use the view with the following settings:

What could be the problem? How can I solve it?

Error with preview in storyboard

Within Xcode 7.0.1 I get the following error in the storyboard:

file:///../Main.storyboard: error: IB Designables: Failed to update auto layout status: The bundle “$(PRODUCT_NAME)” couldn’t be loaded because its executable couldn’t be located.

And there is no preview of the component

UITableView delaysContentTouches

I add HCSStarRatingView into UITableViewCell
Just change HCSStarRatingView value, When you scroll in the presence of "HCSStarRatingView" it does not scroll

I set tableView.delaysContentTouches = true; but not working..

IBDesignable not working properly

...storyboard: error: IB Designables: Failed to render and update auto layout status for ViewController (CvE-oC-4JB): Failed to load designables from path (null)

installing via pod this happens every time I try to use this class in interface builder and then everything disappears (doesnt render) from the view.

Set of default and custom shapes

This control evolved into a much more customised solution. The idea might be to have a set of default shapes (star, circle, etc) that can be chosen, as well as public and easy support for custom shapes.

Fill from right to left

hey is there a way to make it fill the stars from the other direction ( from right to left)???

Push it to cocoapods?

Hi @hugocampossousa
I was always fail to find a nice rating view until I found this one. But it hasn't been pushed to cocoapods yet so that we had to specify the git address after 'pod'. Is there a spefific reason why?

Documentation

Public headers should be documented inline.

Might also be worth creating a cocoadocs.org-compatible documentation.

Podspec

Can we get a podspec? 😬 🍻

About UIControlEventValueChanged

Hi Hugo :
I believe that set the 'value' in storyboard or manually in code shouldn't trigger UIControlEventValueChanged. It might not a perfect match for the idea 'UIControlEvent'.
To test my thoughts, I just create a UISegmentedControl and set the 'selectedSegmentedIndex' in code, it didn't trigger UIControlEventValueChanged. But when you click a segment, it did trigger. So shall we follow this routine too?

Make touch interaction increment by half star

How would you set the touch increment on the stars to increase by half a star each time as your slide? I have set in IB to allow half star and accurate half star, but the selection is still continuous.

Tap gesture not working on iOS 10+

Hello,

First, thanks for sharing this library with us, it's really great.
I'm facing a problem which my tap gesture seems not to be recognized by the UIView.
I did a quick search in the list of closed issues and I found out that I should change is enabled property to false.

I did it and set UserInteractionEnabled to true, but even so my tap gesture still don't work. Do you have any idea what I'm doing wrong?
Here's the full code

reviewsNumber.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(self.openReviews(_:)))) reviewsNumber.isEnabled = false reviewsNumber.isUserInteractionEnabled = true

Star Rating keep same for Next time

First of all i would to say Thanks for great library i am facing some issue like
if i give the rating once so it become full of colour of star,now i want to keep remain if user appear next time into that screen. please help me out!

setting value is not working

Hello and thank you for your work.
I am trying to set the value with .value = ... but the stars don't fill up :(

Any clue on why does this happen?
Thanks

Is it possible to show it on readonly mode?

It seems it's not possible but in case I'm missing something I thought I'd to ask :)

Is any way to disallow edition. I'd like to use the same control to provide the feedback and for showing it on a list.

Great work on this, thanks for sharing!

Problem with spacing when embedded in UIStackView

There seems to be a problem with setting the spacing to a value below 5 when the control is embedded in a UIStackView.

To reproduce this:

  • Open the demo and delete all the constraints in the main storyboard.
  • Select all the views and embed them in a stackview.
  • Constrain the stackview to the edges
  • Let IB auto-fix the hugging priorities
  • Select the topmost HCSStarRatingView and set the spacing to something below 5
  • You will see that the rendering is screwed up in interface builder

Now, when you build and run, it will actually draw correctly in the demo project, but in my own project, it won't, the spacings will be incorrect. I'm not entirely sure if this is really a problem on my side, but I think it's got something to do with the way intrinsicContentSize is calculated. Since you're pinning the height to 44, the spacing will always be incorrect when you constrain the view to a different height.

Value not setting to 0

I'm using rating views in table view cells, where I set the rating value in the cellForRow: method of the table view's data source. It works fine in all cases, except when the value I'm trying to set is 0. In this case, the rating view retains some random value for some reason, and completely ignores the 0.

"Use of @import when modules are disabled" error

Hi,

I currently have an issue with my project. It worked fine so far but when trying to add your cocoapod using
pod 'HCSStarRatingView'
and then using a UIView with class HCSStarRatingView, it displays fine.
But when I want to obtain the selected value, I ctrl-click from the IB to the .h file of my controller, and create:
@property (weak, nonatomic) IBOutlet HCSStarRatingView *rating;

of course the compiler complains to not know HCSStarRatingView, so I add the import above:
#import <HCSStarRatingView/HCSStarRatingView.h>

But that gives the error
Use of '@import' when modules are disabled
pointing at
@import UIKit;
within HCSStarRatingView.h in the source code.

I have searched on google and suggestions claim that Enable modules (C and Objective-C) should be set to Yes, but I don't understand why that would be required, before I have never had this error before adding this Pod.

Are you familiar with the error Use of '@import' when modules are disabled ?
Am I using it wrongly, by coupling the HCSStarRatingView with an IBOutlet?

Thanks

Use custom image?

Hi this library is amazing, i have only a question, i have a custom image of a star, it's possible to use it in this library?

How to setup HCSStarRatingView view in UICollection view cell Swift?

Hello friends,
I am having problem using HCSStarRatingView in UICollection Cell.
How to setup HCSStarRatingView view in UICollection view cell Swift 3?
HCSStarRatingView star value set keeps on changing when rating view in UICollectionView Cell and collection view is scrolled.

I added HCSStarRatingView on UICollection View Cell in storyboard.
Created strong outlet of HCSStarRatingView as

@IBOutlet var ratingView: HCSStarRatingView!

Then in collection view cell for index path code is like this.

func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {

let cell = self.collectionVC.dequeueReusableCell(withReuseIdentifier: "collectionCell", for: indexPath as IndexPath) as! CustomCollectionViewCell

cell.ratingView.value = (self.ratingValueDataArray.value(forKey: "rating") as AnyObject).object(at:indexPath.row) as! CGFloat // setting rating value from JSON array response.
return cell

}

However, for first time value is set on rating view correctly. But on collection view scroll the value is changed on random manner.

Any help?

Thanks

Minimum value option isn't respected

Hello, I've created one and set minimum value to1. Yet if you swipe over to left border of view, view shows 0 stars highlighted, but value is still 1.0.

I've looked around, but not exactly sure where to make change. Maybe we should use setValue: inside _handleTouch and check if it's smaller than minimum here?

iOS8 can't set emptyStarImage

When I used different image between emptyStarImage and filledStarImage in iOS8, but it can't show the emptyStarImage. I don't know why, please help me. Thank you.

Value not updating

After setting the value, it seems that the value does not get updated.
if I do rating.value = 0 and in the IB the value was 2, it still keeps the value from IB.

Values are not updating -Interface Builder

I have added the StarRatings to Interface builder. and using side panel i can update the values and set images fine. but when ever i try to update the values it doesnt effect.

I simply created outlet and created following.
_starRatings = [HCSStarRatingView new];
_starRatings.minimumValue = 0.0;
_starRatings.maximumValue = 5.0;
_starRatings.maximumValue = 2.0;
_starRatings.emptyStarImage = [UIImage imageNamed:@"star_empty"];
_starRatings.filledStarImage = [UIImage imageNamed:@"star_full"];

only displaying values that i added in interface builder.

Star rating in tableview do not show the rating value properly

Hello sir, I have added the star rating view in my app. But i have an issue if i use the star rating in view controller its working fine but if i use this in a table view for multiple rows then the rating is not show properly. if i scroll the tableview the value of upper cells that contains rating view is changed. Please suggest me what can i do to implement it in tableview??

Got error "IB Designables: Failed to update auto layout status" when adding to storyboard.

Installed via Cocoapods 0.37.2. Xcode 6.4.

There are 2 red errors shows up on the left side of Xcode. I can build and run the app but the page that has this view goes blank.

  • xxx/Driver.storyboard: error: IB Designables: Failed to update auto layout status: Failed to load designables from path (null)
  • xxx/Driver.storyboard: error: IB Designables: Failed to render instance of HCSStarRatingView: Failed to load designables from path (null)

Btw, I didn't use use_frameworks! in the Podfile. Is it required?

bitcode problem

i got this error, “HCSStarRatingView.framework/HCSStarRatingView' was built without full bitcode. All frameworks and dylibs for bitcode must be generated from Xcode Archive or Install build for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)” please support bitcode

Custom Image

Hi, bro

I have a problem with RatingView that u posted on Github.

I applied the following source to use a different image, not the existing star image, as you wrote.

starRatingView.emptyStarImage = [UIImage imageNamed:@"heart-empty"]; //like_off_big.png
starRatingView.filledStarImage = [UIImage imageNamed:@"heart-full"];//like_on_big.png

I could see the new image that I put in on RatingView, but when I tried to run RatingView, apps crash. (touched RatingView)

The reason for the crash is

[UIImage renderingMode]: message sent to deallocated instance

I used call stack and figured out the following code occurred the error.

[self _drawStarWithFrame:frame tintColor:self.tintColor highlighted:highlighted]; in drawRect:(CGRect)rect

Could you please let me know how to solve this problem?

Thank you.

Rating is always rounded up

When using half stars, the rating is aways rounded up like so:
For a value of 2.1, the rating view shows 2.5 stars when it should show only 2 stars.

Any properties that handle this? Any way to change that behavior if not?

Allow user to remove rating

Related to discussion in #42, ideally this control would have a behaviour similar to what's currently found in iTunes: when dragging to the left of the control (x<=0), the value 0 is assigned on touch up.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.