0

What I want to is to achieve something like swipe to right to fill-in colors(time availability) on a time-axes. Basically like below:

enter image description here

My solution right now is to use a UICollectionView and make it horizontal and expect to swipe on the UICollectionViewCells in it to fill-in color. But seems like I don't have solid solution to do this. Do you guys have any other better solutions? We actually don't have to use my way like UICollectionView to solve this. Thanks.

Below is what I achieved, currently you can only tap-to-fill-colors, not swipe: enter image description here

don't worry about the upper sliders, it's because the with is too long since I divided the width into 24 hours. the grey thin graduations are just UIView

Invincible_Pain
  • 491
  • 2
  • 6
  • 17
  • As what i can see, looks like you are trying to implement a Gantt Chart for.. I would suggest to use a library such as [https://github.com/keshiim/ZMJGanttChart] – Akhilesh Sharma May 14 '20 at 14:08
  • I'm thinking you could get away with a collection of views. Set a `UISwipeGestureRecognizer` to those views and then as the slide happens loop through the collection of views to set their state as needed. You could get the number of times to loop by checking the views widths and comparing it to the start position of the swipe. – xTwisteDx May 14 '20 at 14:29

0 Answers0