Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change rating by tapping doesn't work anymore #173

Closed
stephanboner opened this issue Oct 2, 2020 · 6 comments
Closed

Change rating by tapping doesn't work anymore #173

stephanboner opened this issue Oct 2, 2020 · 6 comments

Comments

@stephanboner
Copy link

stephanboner commented Oct 2, 2020

  • Library setup method: Swift Package Manager
  • Version of the library: 23.0.0
  • Xcode version: 12.0
  • OS version: iOS 14.0

Since iOS 14.0 / Xcode 12 the tapping doesn't work anymore for me. I have a ScrollView containing among others a UIStackView with different Cells. One of these cells contains a CosmosView which only changes the value if one slides a bit over it - only tapping doesn't work anymore. To make sure, I manually set c.settings.updateOnTouch = true. I tried to debug with breakpoints and I found out that open override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) is not called on touches. Does that have something to do with my setup or is this an issue which others are also facing?

I also set the Can Cancel On Scroll property from my UIScrollView to false as suggested in #156

@evgenyneu
Copy link
Owner

Thanks for reporting the issue, @SSB95. Is it possible to isolate the bug into a demo app and attach here so I can have a look?

The tapping on stars in a scroll view is working for me in the demo app in Xcode 12 / iOS 14, just checked.

@stephanboner
Copy link
Author

Hey, thanks for your answer! I've attached a sample app which gets as close to my app and also has this behavior that tapping doesn't work.

CosmosTest.zip

@evgenyneu
Copy link
Owner

Thanks! Nice code btw. The tapping started to work after I commented this in DataCell.swift:

addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(didTapCell)))

@stephanboner
Copy link
Author

Thanks :)

Oh wow, thank you very much! The simplest solution now is to just change the code like this:

let gestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(didTapCell))
gestureRecognizer.cancelsTouchesInView = false
addGestureRecognizer(gestureRecognizer)

I tested it and it works like this. So I assume there is no further work required?

@evgenyneu
Copy link
Owner

That cancelsTouchesInView = false fix looks reasonable.

So I assume there is no further work required?

Let's hope so, let me know if you notice any problems.

@stephanboner
Copy link
Author

I will, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants