evgenyneu / Cosmos

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

First touch in collectionView #170

Closed oguzveozturk closed 3 years ago

oguzveozturk commented 3 years ago

Hi, When cosmos inside collectionViewCell scrolling is not working properly. because when i start scrolling at the collectionview's random point, it is working. But when my first touch position is on the cosmosView, scroll is not working. After that my touches triggered cosmosView unless rating is finished. I want to cosmosView only trigger by horizontal touches or single taps. Any suggestions?

👏🏼 ln the meantime, thank you so much for your attention and participation👏🏼

evgenyneu commented 3 years ago

Hi @oguzveozturk, good question. Did you try enabling "Can cancel on scroll" in the Attributes Inspector for the scroll view?

oguzveozturk commented 3 years ago

Yes, i did. Same result unfortunately.

evgenyneu commented 3 years ago

Ok, is it possible to isolate the issue in a demo app and attach it here so I can have a look?

oguzveozturk commented 3 years ago

Okey. I do my best. Thanks

oguzveozturk commented 3 years ago

hi @evgenyneu you can look this: Demoapp.zip

evgenyneu commented 3 years ago

It works well for me when I comment out this line in ViewController.swift

// cosmosView.settings.disablePanGestures = true
oguzveozturk commented 3 years ago

Sorry @evgenyneu but not working usually. yes, sometimes scroll event triggered first. but sometimes : (

evgenyneu commented 3 years ago

sometimes scroll event triggered first. but sometimes : (

Hmm, yeah, this is messy. I think the problem is that the Scroll View tries to distinguish between scrolling and tapping the Cosmos view. If the interval between tap and scroll is small, it does the scroll (when Delay Touch Down is on). Otherwise - the tap. I don't know how to solve this problem even in principle, it's fuzzy.

oguzveozturk commented 3 years ago

Okey i understand. But I must say; on the simulator, mouse clicking much pointy than finger touches. I ran it on the real device. Still not perfect but so much better than before.

Thank you for response again🙏🏼

evgenyneu commented 3 years ago

on the simulator, mouse clicking much pointy than finger touches. I ran it on the real device.

Oh, that's good!