|
|
@@ -88,20 +88,20 @@ final class DragGestureController {
|
|
88
|
88
|
else { return CGPoint.zero }
|
|
89
|
89
|
|
|
90
|
90
|
let currentSize = view.frame.size
|
|
91
|
|
- let adjustedBounds = UIEdgeInsetsInsetRect(bounds, insets)
|
|
|
91
|
+ let adjustedBounds = bounds.inset(by: insets)
|
|
92
|
92
|
let threshold: CGFloat = 20.0
|
|
93
|
93
|
let velocity = panGesture.velocity(in: view.superview)
|
|
94
|
94
|
let location = panGesture.location(in: view.superview)
|
|
95
|
95
|
|
|
96
|
96
|
let goLeft: Bool
|
|
97
|
|
- if fabs(velocity.x) > threshold {
|
|
|
97
|
+ if abs(velocity.x) > threshold {
|
|
98
|
98
|
goLeft = velocity.x < -threshold
|
|
99
|
99
|
} else {
|
|
100
|
100
|
goLeft = location.x < bounds.midX
|
|
101
|
101
|
}
|
|
102
|
102
|
|
|
103
|
103
|
let goUp: Bool
|
|
104
|
|
- if fabs(velocity.y) > threshold {
|
|
|
104
|
+ if abs(velocity.y) > threshold {
|
|
105
|
105
|
goUp = velocity.y < -threshold
|
|
106
|
106
|
} else {
|
|
107
|
107
|
goUp = location.y < bounds.midY
|