Comments (24)
@iverde, thanks for reporting. It looks like your issue with the frame size was similar to the one that was fixed today in version 10. There should be no need to update the frame size manually from now on. :)
from cosmos.
@ankraft, you are right. It looks like, once you start scrolling, the scroll view does not pass touches to its subviews and CosmosView does not receive them. I managed to make it work by disabling Cancellable Content Touches for the scroll view. This has a side effect, unfortunately. If you start interacting with CosmosView you can not longer scroll until you finish changing the rating.
Here is the demo app.
Let me know if it works for you.
from cosmos.
Hello ! First, thanks for this amazing tool !
I just had the same issue and thank god I found this thread.
Just wanted to add a little detail is that when devloping views in code, without storyboards, then
scrollView.delaysContentTouches is false
by default.
Thankfully I saw @evgenyneu screenshot I tried this setting :)
So the fix (in code) is:
scrollView.canCancelContentTouches = false
scrollView.delaysContentTouches = false
Cheers,
from cosmos.
Oops my bad then thanks @NiyogRay for spotting that :)
from cosmos.
Hello @SlavcoPetkovski, thank you for the feedback, this is very interesting. I created a demo app with a scrollview. Cosmos view seems to change stars for me without any problem, whether I tap it or swipe. I tried it both in the Simulator and on device and could not reproduce this problem.
Here is the demo app project (Xcode 8 beta 4):
Do you think you could isolate your issue in a demo app so I can try it?
from cosmos.
Hi @SlavcoPetkovski, do you still have the issue?
from cosmos.
I dont have xcode 8 ... Cant test the sample project
Sent from my iPhone 6
On 09.9.2016, at 09:31, Evgenii Neumerzhitckii [email protected] wrote:
Hi @SlavcoPetkovski, do you still have the issue?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
from cosmos.
Oh sorry, here is the Xcode 7 demo.
UsingCosmosInScrollViewXcode7.zip
from cosmos.
Weird, tried everything but in your projects everything is smooth, but in mine i present the view controller with self.storyboard.instantiate and it is hard to set rating. It works but you have to be very precise on the star...
Sent from my iPhone 6
On 09.9.2016, at 10:42, Evgenii Neumerzhitckii [email protected] wrote:
Oh sorry, here is the Xcode 7 demo.
UsingCosmosInScrollViewXcode7.zip
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
from cosmos.
This is very puzzling indeed. I would suggest isolating your case in a sample app, to reduce the complexity. It may help finding the cause of the issue. It probably involves the layout and positioning of the CosmosView, as well as the size of it, since it influences the touch target. I know, it is very general advice but it is hard to be more specific without looking at the code. Let me know how it goes.
from cosmos.
I encountered the same or at least a very similar problem.
- I have Cosmos rating view in a cell defined in a storyboard for a UITableView
- I added a block to the rating for "didFinishTouchingCosmos"
- Select a star or swipe to left to remove a rating
- While keeping my finger (mouse in the simulator) touching the screen, I start to swipe up or down
- When stop the touch, the block assigned above doesn't fire, but the value of the rating still changes
I hope this helps.
from cosmos.
Hi @ankraft, thanks for reporting. Do you mind creating a new issue for this? It may be a different problem, since it occurs in the table view and not in the scroll view. Just want to keep things organized so we can address them one by one. Thanks
from cosmos.
I forgot to mention: The superview of the table is a scroll view.
As long as there is no vertical scrolling the rating view works fine. I have the feeling that in case when another view starts to scroll the rating view looses the focus but the "didFinishTouchingCosmos" block isn't executed.
from cosmos.
@evgenyneu, thanks a lot for looking into this. Your solution works perfectly with my app!
Regarding the side effect: I think that it is actually a better UX not to scroll the view when the user is interacting with a control in that view.
Perhaps you should copy the screenshot and the explanation to the usage section in the README.md :)
Thanks again!
from cosmos.
I am glad it helped. I will put it in the readme, as you suggested, since it can be a common problem. All the best.
from cosmos.
Hello @evgenyneu thank you for fantastic library.
I have cosmos view in table view (inside UITableViewCell). 'Cancellable Content Touches' is disabled. But 'didTouchCosmos' doesn't work sometime. I'm using swift_2.3 branch.
Can you advice me something?
from cosmos.
Hi @Rommanski, thank you for kind words. For which view 'Cancellable Content Touches' is disabled? Could you describe how you interact with the table view when it does not fire didTouchCosmos
? Thanks.
from cosmos.
Hello @evgenyneu. Thank you for your quick response.
I have disabled 'Cancellable Content Touches' for table view. But looks like I solved an issue. I'm using didFinishTouchingCosmos
instead of didTouchCosmos
.
Could you describe how you interact with the table view when it does not fire didTouchCosmos?
Cell has rating view, and user just clicks. I do not feel any different in user behaviors when didTouchCosmos
doesn't fire.
Thank you so much again!
from cosmos.
@Rommanski I am glad you found a solution. It is still weird that didTouchCosmos
did not work though.
from cosmos.
I had similar problems in a Scroll View with start's size of 30. In my case was because of CosmosView's size.
You can try this:
cosmosView.backgroundColor = UIColor.blue
If background does not cover all, that is the problem. You can modify size manually like this:
cosmosView.frame = GCRect(X: 100, y:100, width: 300, height: 300)
Great library anyway, thanks @evgenyneu ;)
from cosmos.
Closing the issue. Feel free to reopen if needed.
from cosmos.
@s4cha, thanks for sharing your solution. 👍
from cosmos.
Thankfully I found this issue thread :) I am wondering how the native UISlider manages to work fine in a UIScrollView. Could something similar be done by default for Cosmos, so we dont have to worry about disabling 'Can Cancel on Scroll' ?
from cosmos.
@s4cha thanks for your solution, but you accidentally wrote:
scrollView.delaysContentTouches = false
instead of what you meant
scrollView.delaysContentTouches = true
from cosmos.
Related Issues (20)
- Unwanted behavior in a UIScrollView HOT 4
- Please add macOS support in SwiftUI HOT 3
- How to disable tapping? HOT 2
- How to set empty image for empty start(non partially filled as well) HOT 6
- My image and `withTintColor` HOT 2
- How to prevent didTouchCosmos from issuing a rating
- Can you please build the framework for the Simulator HOT 3
- [Feature Request] Add custom image for half star HOT 4
- Filled color values changing even though the data is not. HOT 6
- Error While installing pod. HOT 1
- Tap gesture recognizer messes up Cosmos HOT 1
- Build failed in Storyboard
- Showing Recent Messages /Package.swift has no Package.swift manifest for version 9.0.0 in https://github.com/evgenyneu/Cosmos.git
- Single star doesn't show precise filling.
- Tapping on Rating always select 3 rating when VoiceOver is on
- Remove rating after giving
- Set custom accessibilityLabel for Cosmos View HOT 1
- demo
- Privacy Manifests HOT 21
- I have error when run demo project
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cosmos.