ShingoFukuyama / 3DTouchDetectStateOfPeekPopCancel

Swift sample code: Detect 3D Touch Peek/Pop and Peek-Cancel
9 stars 1 forks source link

3D Touch sample - Detecting Peek/Pop/Peak-Cancel

Peek

Check gesture state of previewingGestureRecognizerForFailureRelationship property of UIViewControllerPreviewing. When peeking, the state is .Began or .Changed.

Pop

Before popped, previewingContext(_:commitViewController:) method called.

Peek-Cancel

Observe gesture state of previewingGestureRecognizerForFailureRelationship by KVO (Key-Value Observing)

demo