material-motion-archive / direct-manipulation-swift

Archived February 16, 2017 :: Direct Manipulation for Apple devices
Apache License 2.0
1 stars 1 forks source link

Introduce an instantly-reactive gesture recognizer for pan/pinch/rotate #20

Open jverkoey opened 8 years ago

jverkoey commented 8 years ago

UIKit's gesture recognizers include a slop region. This slop region isn't always desirable for direct manipulation scenarios.

We should explore how we might provide pinch/rotate/pan support without a slop region.

One option is to implement a new UIGestureRecognizer subclass. This means we need to implement our own velocity calculations, which poses a serious risk of deviating from UIKit's velocity calculation logic.

If we can somehow utilize the existing gesture recognizers that would be preferable.

jverkoey commented 7 years ago

This is doable if we provide a subclass that overrides touchesBegan and immediately sets state = .began. I've verified that velocity is still generated as expected.