Giter Club home page Giter Club logo

cosmos's Issues

Xcode 8.1 - Swift 3.0.1 support

Hi,

There is a support for these versions (Xcode 8.1 - Swift 3.0.1)?

I have this error:

“Use Legacy Swift Language Version” (SWIFT_VERSION) is required to be configured correctly for targets which use Swift. Use the [Edit > Convert > To Current Swift Syntax…] menu to choose a Swift version or use the Build Settings editor to configure the build setting directly.

Thanks!

Custom image?

Your library is a great example of modern iOS control, I really appreciate your effort!

Is there an easy way to use a custom images instead of stars?

Cosmos on UITableViewCell

How can we use Cosmos Star on UITableViewCell , since my requirement is to get multiple rating stars to rate on specific cell index and send to server

didTouchCosmos closure can capture self

I'd be safer to change this

cosmosView.didTouchCosmos = { rating in }

to this

cosmosView.didTouchCosmos = { [unowned self] rating in }

in case if we'd use this code within view controller. Otherwise didTouchCosmos closure captures a reference to self and retain cycle is created.

Using Cosmos in tvOS app with CocoaPods shows error Library not loaded: @rpath/libswiftCore.dylib

@staticdreams, thanks for adding tvOS support. I was testing this change by creating a new tvOS app and adding Cosmos via CocoPods. Then I created a view in storyboard and assigned its class to CosmosView. After that I got an error:

... Base.lproj/Main.storyboard: error: IB Designables: Failed to render and update auto layout status for ViewController (BYZ-38-t0r): dlopen(Cosmos.framework, 1): Library not loaded: @rpath/libswiftCore.dylib
Referenced from: Cosmos.framework
Reason: image not found

I tried using Cosmos with file and Carthage methods in tvOS app - both worked. It is the CocoaPods method that does not work.

xCode8 , Swift 2.3 and Storyboard

Hello,

First of all , congratulations for your library. It's amazing!
I'm working on update my project to xCode 8, but I got an issue with Cosmos framework.
This is the message I get from xCode:

error: IB Designables: Failed to update auto layout status: dlopen(Cosmos.framework, 1): Symbol not found: __TWPSis16ForwardIndexTypes
  Referenced from: Cosmos.framework
  Expected in: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Xcode/Overlays/../../../../../../Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/libswiftCore.dylib
 in Cosmos.framework

Do you have any idea of how to solve this problem?

Thanks in advance,
Renan.

tableviewcell implementation

Hi I am using custom tableview cell and trying to implemet your control into my project.
In my tableviewcell class I am creating Outlet @IBOutlet weak var ratingStar: TegStarRatingView!

Than in my cellforatindexpath

doing this:

cell.ratingStar.settings.starColorFilled = UIColor.blackColor()
cell.ratingStar.settings.starFillMode = TegStarFillMode.Full
cell.ratingStar.show(rating: 3.0)

but getting always this error
fatal error: unexpectedly found nil while unwrapping an Optional value

//debug console
po cell.ratingStart
nil

What I am doing wrong?

Can't get Tap Gesture UIState Began

I needed to know when the cosmo stars are being pressed to caused other things in the view to happen. It seems when you add a UITapGestureRecognizer on the CosmoView you only get Ended and don't get began. Amazing job otherwise.

`let gestureViewCosmoTapped: UITapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(ViewController.tapGestureViewCosmo))

func tapGestureViewCosmo(sender: UITapGestureRecognizer){
print("Tap : " + String(sender.state.rawValue))
if (sender.state == UIGestureRecognizerState.Ended){
print("ended")
}else if (sender.state == UIGestureRecognizerState.Changed){
print("changed")
}else if (sender.state == UIGestureRecognizerState.Began){
print("began")
}else if (sender.state == UIGestureRecognizerState.Cancelled){
print("cancelled")
}else{
}
}`

Readme wrong re: Swift 2.3 branch?

Hi there,

Thanks so much for this awesome library!

My company is still using swift 2.3, and adding github "marketplacer/Cosmos" ~> 1.2 to the Cartfile did not work. It did work when I added github "marketplacer/Cosmos" "swift-2.3", however, so I don't think the branch itself is the issue. Is there possibly a typo in the readme regarding the version number?

Thanks in advance!

Align rating to Right inside the cosmos uiview

I want to align cosmos view to right without applying fixed size width constraint. For example I am having cosmos view of width 80 but it's actual content (i.e. 5 stars) are of width 60 which I want them to align right instead of left.

Please help.

Code-compliant issues

Recently i've downloaded the library and embedded it into my project using Cocoapods ~ 1.1.1. Everything worked fine until when i tried to add Cosmos rating view into table cell and try to manipulate it with different rating values on the controller side and end up getting this error during run-time:

*** Terminating app due to uncaught exception 'NSUnknownKeyExeption', reason: setValue:forUnderfinedKey:]: this class is not key value coding-compliant for the key RatingView.***

Is there anything that i might have missed, i tried to follow everything as explained at the intro yet this error still exists.

IDE: Xcode ~ 8.2.1

IB Designable error

Main.storyboard: warning: IB Designables: Using class UIView for object with custom class because the class CosmosView does not exist

--

If I am missing a setting or checking off something, please let me know. I am a new user to this control.

-Kevin.

Changing size of individual star?

Hi, great work with the library!

Is there a way to change the size of one star and keep the others unchanged? I want the size of one star to increasingly get bigger the longer a user holds it.

How To save Ratings in variables?

Hi,

Could you provide a short example on how to use didFinishTouchingCosmos and save values in variables?
It is not very clear to me in the read me file, sorry.

thanks,

I am receiving a warning that M_PI is deprecated in Xcode 8.3.3

/Users/carlosdelamora/Desktop/my apps/MonEx/Pods/Cosmos/Cosmos/CosmosLayers.swift:93:56: 'M_PI' is deprecated: Please use 'Double.pi' or '.pi' to get the value of correct type and avoid casting.

In order to change it to Double.pi as the message suggest I need to unlock cosmos code, I do not want to do this. Is there another way around it, like an update or something?

Set rating on tap

I may be doing something wrong, but currently I can only set the rating by touching and sliding from left to right. I cannot simply tap a star to set the rating. If this is possible, how is it implemented?

Thanks,
Jerry

Swift 2.3 compatible version in Cocoapods

We are using this library in other library and we need to be compatible with swift 2.3, Can you please upload the latest changes of the swift2 branch to cocoapods? It would be a great help

Thank you!

Kind regards

Having trouble getting stars to show

I am putting a View inside a TableViewCell via storyboard. I've set the width of the view to 60, height to 20.
I set the view to class ComosView, and via the attribute inspector, I set
Rating: 5, text 0, total Stars 5, star size 20.
Filled colors, empty colors...etc.

However, when i run it in the simulator, (i expect to see 5 stars filled). But the view is empty.
I have no idea why. What might I be doing wrong?

Secondary question, I've also tried to set rating programatically when configuring the tableviewcell, however, I get a exc_bad_access.

Can't change value of cosmos

Similar to #31, I have a CosmosView inside a UITableViewCell. Normally it works fine.

However, when I add a UITapGestureRecognizer to my UITableView, I can no longer change the value of CosmosView by tapping.

I have to hold touch on CosmosView to actually work after adding the UITapGestureRecognizer.

I am using UITapGestureRecognizer for dismiss keyboard functionality. And this is how I add UITapGestureRecognizer.

        let tapQuit = UITapGestureRecognizer(target: self, action: #selector(FeedTableViewController.dismissKeyboard(_:)))
        tableView.addGestureRecognizer(tapQuit)

I have also enabled cosmosview.settings.updateOnTouch = true

So my question is, is there any way to make it work with UITapGestureRecognizer. Or should I just get rid of UITapGestureRecognizer, and try to solve dismiss keyboard with some other way?

Thanks!

Please help add view in code

Could you please help me how to write the code to add Cosmos without storyboard? I need a row with a variable amount of cosmos UIViews depending on the size of an array.

I did not understand how you meant this:
"Alternatively, one can instantiate CosmosView class and add it to the view manually without using Storyboard."

Thank you very much in advance!!

Cosmos not "touching" in tableviewcell

Hi! i set up a tableviewcell with a few components including a cosmos view. At first i was able to get feedback using the didFinishTouchingCosmos function on my cell after i called the dequeueReusableCellWithIdentifier. But for some reason now, the cosmos interaction has seemed to have been turned off. Any idea why this is happening?

not exist cosmos

hello @evgenyneu evgeny
when I Set the view's class to CosmosView in the Identity Inspector .
warning: IB Designables: Using class UIView for object with custom class because the class CosmosView does not exist
Because you know it ?

On click of an already rated star how can I uncheck it

I have followed the readme and implemented the Cosmos view.
I have set the fill mode to half. However only from the second star I am able to rate half a star. The first star fills up completely.
Also on click of a star that is already filled I want to uncheck it i.e I want the rating to be 0 if the rating was 1 . How can I solve this?

Swift 1.2 not compatible

I am working on a project using Swift 1.2 and am unable to use Cosmos is there a 1.2 compatible version still available?

Changelog File

Please add a CHANGELOG.md file to make it easier to see what's changed with each release.

is there any didTouchFinish?!

hi.
thank for your great work.
how i can know if touch is finished?
i want to send selected rate to server after user set the rate.
i used didTouchCosmos,but it is not good way to send rated value to server!

Selecting by swipe

Thank you for this nice and simple UI item!

What setting should I use in order to enable selecting star by swipe. Right now I can use selection of only by tapping one of stars

Error when load it to TableView

I drag a view and set its class to CosmosView, but when I run the project, it crashes:

Failed to set (rateLineWidth) user defined inspected property on (Cosmos.CosmosView): [<Cosmos.CosmosView 0x7ff150d53e70> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key rateLineWidth.

Unable to select more than 5 stars with default size settings

I set 6 total stars and a star size of 30.0, in this way I cannot select more than 4 stars.
Setting 6 total star and the default star size, I cannot select more than 5 stars.
Seems like the touchable area remains always at the default size, not updating once the drawn area changed.

Does not compile from within an Extension

When compiling from within an extension (e.g. a Notification Content Extension), UIApplication.shared is not available and the compiler throws an error in RightToLeft.swift

...Cosmos/Helpers/RightToLeft.swift:14:28: 'shared' is unavailable: Use view controller based solutions where appropriate instead.

Text positioning

Is there a way to positioning the text in other position then on the right?
It was nice to be possible to position the text on either of the sides, top, bottom, left and right.

Thanks.

Right To Left Support

Hi,
first of all i'd like to thank you for this framework but i have a question . i there any plane for this framework to support right to left languages ?

didTouchCosmos called Twice

Its working in Emulator, but in device if not selected precisely inside star, didTouch is getting called twice and sets the max rating possible.

How to trigger an action after user selecting certain number of stars

How to trigger an action after user selecting certain number of stars, e.g. if user selected all five stars that are shown, the app wants to show an alert.

The author provided two functions:

// Called when user finishes changing the rating by lifting the finger from the view.
// This may be a good place to save the rating in the database or send to the server.
cosmosView.didFinishTouchingCosmos = { rating in }

// A closure that is called when user changes the rating by touching the view.
// This can be used to update UI as the rating is being changed by moving a finger.
cosmosView.didTouchCosmos = { rating in }

which seem to be for the purpose.

Can you please tell me where I can use the above pieces of code? You do not seem to provide any deletage like UITableView.

I am a beginner iOS programmer so I really hope you can help.

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.