Skip to content

Using Cosmos in a scroll view

Evgenii Neumerzhitckii edited this page Dec 18, 2017 · 20 revisions

The demo app contains a Performance screen that demonstrates how to use Cosmos in a table view. There is one nuance to be aware of if you are using Cosmos in a scroll view or a table view.

After the user started scrolling, the scroll view does not pass touches to its subviews and CosmosView does not receive them. This may result in not receiving callbacks didFinishTouchingCosmos and didTouchCosmos when the scrollview is being scrolled.

The issue can be fixed by disabling Can cancel on scroll for the scroll view (or Cancellable Content Touches in order Xcode). This has a side effect, unfortunately. If you start interacting with CosmosView you can no longer scroll until you finish changing the rating.

Cosmos in a scroll view can cancel on scroll
Clone this wiki locally