-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDefaultDetectGesture.swift
More file actions
33 lines (30 loc) · 1.48 KB
/
DefaultDetectGesture.swift
File metadata and controls
33 lines (30 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/// Default Gestures
import Foundation
public enum DefaultDetectGesture {
/// Single tap gesture
case tap(allowMultiTap: Bool = false, checkOnlyLastTap: Bool = true)
/// Long press gesture with minimum duration
case longTap(milliSecondsForDetection: TimeInterval? = nil, allowMultiTap: Bool = false, checkOnlyLastTap: Bool = true)
/// Drag gesture with minimum distance
case drag(minimumDistance: CGFloat, allowMultiTap: Bool = false, checkOnlyLastTap: Bool = true)
/// Slide gesture in a specific direction with minimum distance
case slide(direction: DefaultDetectGestureDirection, minimumDistance: CGFloat, allowMultiTap: Bool = false, checkOnlyLastTap: Bool = true)
// TODO: Configure velocity
/// Swipe gesture in a specific direction
case swipe(direction: DefaultDetectGestureDirection, minimumVelocity: CGFloat = 300, allowMultiTap: Bool = false, checkOnlyLastTapSequence: Bool = true)
/// Sequential tap gesture with count and maximum interval between taps
case sequentialTap(count: Int, maximumTapIntervalMilliseconds: TimeInterval, checkOnlyLastTap: Bool = true)
/// Pinch gesture on a specific axis with minimum distance change
case pinch(minimumDistance: CGFloat, checkOnlyLastTap: Bool = true)
}
/// Direction for gesture detection
public enum DefaultDetectGestureDirection {
/// Upward direction
case up
/// Downward direction
case down
/// Leftward direction
case left
/// Rightward direction
case right
}