Giter Club home page Giter Club logo

Comments (24)

evgenyneu avatar evgenyneu commented on August 28, 2024 2

@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.

evgenyneu avatar evgenyneu commented on August 28, 2024 1

@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.

cosmos_scroll_view_cancellable_content_touches

Here is the demo app.

UsingCosmosInScrollView.zip

Let me know if it works for you.

from cosmos.

s4cha avatar s4cha commented on August 28, 2024 1

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.

s4cha avatar s4cha commented on August 28, 2024 1

Oops my bad then thanks @NiyogRay for spotting that :)

from cosmos.

evgenyneu avatar evgenyneu commented on August 28, 2024

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.

cosmos_in_scroll_view

Here is the demo app project (Xcode 8 beta 4):

UsingCosmosInScrollView.zip

Do you think you could isolate your issue in a demo app so I can try it?

from cosmos.

evgenyneu avatar evgenyneu commented on August 28, 2024

Hi @SlavcoPetkovski, do you still have the issue?

from cosmos.

SlavcoPetkovski avatar SlavcoPetkovski commented on August 28, 2024

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.

evgenyneu avatar evgenyneu commented on August 28, 2024

Oh sorry, here is the Xcode 7 demo.

UsingCosmosInScrollViewXcode7.zip

from cosmos.

SlavcoPetkovski avatar SlavcoPetkovski commented on August 28, 2024

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.

evgenyneu avatar evgenyneu commented on August 28, 2024

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.

ankraft avatar ankraft commented on August 28, 2024

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.

evgenyneu avatar evgenyneu commented on August 28, 2024

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.

ankraft avatar ankraft commented on August 28, 2024

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.

ankraft avatar ankraft commented on August 28, 2024

@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.

evgenyneu avatar evgenyneu commented on August 28, 2024

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.

bohachevskyy avatar bohachevskyy commented on August 28, 2024

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.

evgenyneu avatar evgenyneu commented on August 28, 2024

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.

bohachevskyy avatar bohachevskyy commented on August 28, 2024

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.

evgenyneu avatar evgenyneu commented on August 28, 2024

@Rommanski I am glad you found a solution. It is still weird that didTouchCosmos did not work though.

from cosmos.

iverde avatar iverde commented on August 28, 2024

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.

evgenyneu avatar evgenyneu commented on August 28, 2024

Closing the issue. Feel free to reopen if needed.

from cosmos.

evgenyneu avatar evgenyneu commented on August 28, 2024

@s4cha, thanks for sharing your solution. 👍

from cosmos.

NiyogRay avatar NiyogRay commented on August 28, 2024

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.

NiyogRay avatar NiyogRay commented on August 28, 2024

@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)

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.