evgenyneu / Cosmos

A star rating control for iOS/tvOS written in Swift
MIT License
2.18k stars 366 forks source link

How to swipe cosmos to leave a rating inside a cell without swiping the cell #168

Open lsamaria opened 4 years ago

lsamaria commented 4 years ago

Please consider submitting the following information (if relevant):

• Library setup method: CocoaPods • Version of the library. pod 'Cosmos', '~> 22.1' • Xcode version. 11.5 • OS version. Example: iOS 13.5

I'm using a collectionView cell and inside of it I have the cosmos component. How can I swipe the cosmos to get a rating without worrying about swiping the cell?

For example if I try to swipe the cosmos to leave a rating, the cell swipes, I have no choice but to tap the cosmos. Tapping works fine but I like the swipe rating feature and don't want to lose it. I also don't want to lose the ability to swipe the cell meaning swiping the cell itself has nothing to do with swiping the cosmos to leave a rating.

My code is programmatic, I don't use storyboard at all.

lsamaria commented 4 years ago

answer is here, just replace slider with cosmosView

https://stackoverflow.com/a/62925429/4833705