https://github.com/neobeppe/gtforcetouchgesturerecognizer
Lightweight library to use 3D touch as gesture recognizer on iOS
https://github.com/neobeppe/gtforcetouchgesturerecognizer
3d-touch gesture-recognizer swift
Last synced: 10 months ago
JSON representation
Lightweight library to use 3D touch as gesture recognizer on iOS
- Host: GitHub
- URL: https://github.com/neobeppe/gtforcetouchgesturerecognizer
- Owner: neobeppe
- License: mit
- Created: 2017-02-28T08:57:24.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2019-11-25T12:24:03.000Z (over 6 years ago)
- Last Synced: 2025-04-23T23:14:30.686Z (about 1 year ago)
- Topics: 3d-touch, gesture-recognizer, swift
- Language: Swift
- Homepage:
- Size: 47.9 KB
- Stars: 7
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GTForceTouchGestureRecognizer
[](https://travis-ci.org/neobeppe/GTForceTouchGestureRecognizer)
[](https://coveralls.io/github/neobeppe/GTForceTouchGestureRecognizer?branch=swift4)
[](http://cocoapods.org/pods/GTForceTouchGestureRecognizer)
[](http://cocoapods.org/pods/GTForceTouchGestureRecognizer)
[](http://cocoapods.org/pods/GTForceTouchGestureRecognizer)
## Requirements
iOS 10 is required.
## Installation
#### CocoaPods
GTForceTouchGestureRecognizer is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:
```ruby
pod "GTForceTouchGestureRecognizer"
```
#### Swift Package Manager
You can use [The Swift Package Manager](https://swift.org/package-manager) to install `GTForceTouchGestureRecognizer` by adding the proper description to your `Package.swift` file:
```swift
import PackageDescription
let package = Package(
name: "YOUR_PROJECT_NAME",
targets: [],
dependencies: [
.Package(url: "https://github.com/neobeppe/GTForceTouchGestureRecognizer.git"),
]
)
```
Note that the [Swift Package Manager](https://swift.org/package-manager) is still in early design and development, for more information checkout its [GitHub Page](https://github.com/apple/swift-package-manager)
#### Manually
To use this library in your project manually you may:
1. for Projects, just drag GTForceTouchGestureRecognizer.swift to the project tree
2. for Workspaces, include the whole GTForceTouchGestureRecognizer.xcodeproj
## Usage
You can simply instantiate an GTForceTouchGestureRecognizer and add it to a view.
```swift
let forceTouchGestureRecognizer = GTForceTouchGestureRecognizer(target: self, action: #selector(someFunction:))
view.addGestureRecognizer(forceTouchGestureRecognizer)
```
Optionally you can specify:
* force percentage `threshold`, which is 0.75 by default
* `hardTriggerMinTime` minimum time after force touch has began
## License
GTForceTouchGestureRecognizer is available under the MIT license. See the LICENSE file for more info.