OfTheWolf / UBottomSheet

iPhone Maps App bottom sheet - A Protocol Oriented Approach
MIT License
641 stars 68 forks source link

Bug in velocity #63

Open rocketnik opened 3 years ago

rocketnik commented 3 years ago

Please take a look at if velocity.y < 100 { /// dragging up It should be if velocity.y < -100 { /// dragging up

As I understand this is for fast dragging which should always select the next point in direction of the drag instead of find the closes point, which could mean going back a bit.

Having the sheet almost closed (dragged to bottom) and then moving slightly (not matter if up or down) of speed of 5 or -5, it will be below 100 and interpreted as fast drag up, which it is not. It would be a drag up, if velocity was negative and it would be a fast drag up, if velocity was below -100.

OfTheWolf commented 3 years ago

@rocketnik That's correct. Also /// dragging up, down comments are misleading and should be removed.

rocketnik commented 3 years ago

To my understanding the comments are correct. Maybe add the word “fast” before “drag”