Before iOS 16 and macOS 13, SwiftUI didn't return the gesture location. It is a lightweight open-source extension to SwiftUI's gesture API.
Rectangle()
.onTouchGesture(count: 1) { gesture in
print(gesture.location)
}
.onSwipeGesture(minimumDistance: 15.0, coordinateSpace: .local) { direction, location in
print(direction, location)
} onEnded: { direction, location in
print(direction, location)
}
Add the following dependency to your Package.swift file:
.package(url: "https://github.com/vospennikov/Gestures.git", .upToNextMinor(from: "1.0.4"))
Gestures is available under the MIT license. See the LICENSE file for more info.
link |
Stars: 0 |
Last commit: 1 week ago |
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics