|
|
@ -127,16 +127,18 @@ class ImageEditorGestureRecognizer: UIGestureRecognizer {
|
|
|
|
return isNewTouch ? .invalid : .outside
|
|
|
|
return isNewTouch ? .invalid : .outside
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Ignore touches that start near the top or bottom edge of the screen;
|
|
|
|
if isNewTouch {
|
|
|
|
// they may be a system edge swipe gesture.
|
|
|
|
// Ignore touches that start near the top or bottom edge of the screen;
|
|
|
|
let rootView = self.rootView(of: view)
|
|
|
|
// they may be a system edge swipe gesture.
|
|
|
|
let rootLocation = firstTouch.location(in: rootView)
|
|
|
|
let rootView = self.rootView(of: view)
|
|
|
|
let distanceToTopEdge = max(0, rootLocation.y)
|
|
|
|
let rootLocation = firstTouch.location(in: rootView)
|
|
|
|
let distanceToBottomEdge = max(0, rootView.bounds.size.height - rootLocation.y)
|
|
|
|
let distanceToTopEdge = max(0, rootLocation.y)
|
|
|
|
let distanceToNearestEdge = min(distanceToTopEdge, distanceToBottomEdge)
|
|
|
|
let distanceToBottomEdge = max(0, rootView.bounds.size.height - rootLocation.y)
|
|
|
|
let kSystemEdgeSwipeTolerance: CGFloat = 50
|
|
|
|
let distanceToNearestEdge = min(distanceToTopEdge, distanceToBottomEdge)
|
|
|
|
if (distanceToNearestEdge < kSystemEdgeSwipeTolerance) {
|
|
|
|
let kSystemEdgeSwipeTolerance: CGFloat = 50
|
|
|
|
return .invalid
|
|
|
|
if (distanceToNearestEdge < kSystemEdgeSwipeTolerance) {
|
|
|
|
|
|
|
|
return .invalid
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return .valid
|
|
|
|
return .valid
|
|
|
|