Swiftpack.co - vospennikov/Gestures as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by vospennikov.
vospennikov/Gestures v1.0.3
SwiftUI gesture extensions
⭐️ 0
🕓 9 weeks ago
iOS macOS
.package(url: "https://github.com/vospennikov/Gestures.git", from: "v1.0.3")

Gestures

Swift Platform Framework Swift Package Manager GitHub Demo

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.

Usage

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)
  }

Installation

Swift Package Manager

Add the following dependency to your Package.swift file:

.package(url: "https://github.com/vospennikov/Gestures.git", .upToNextMinor(from: "1.0.4"))

License

Gestures is available under the MIT license. See the LICENSE file for more info.

GitHub

link
Stars: 0
Last commit: 1 week ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Release Notes

2 weeks ago

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics