Swiftpack.co - neobeppe/GTForceTouchGestureRecognizer as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by neobeppe.
neobeppe/GTForceTouchGestureRecognizer 1.1.2
Lightweight library to use 3D touch as gesture recognizer on iOS
⭐️ 7
🕓 4 years ago
iOS
.package(url: "https://github.com/neobeppe/GTForceTouchGestureRecognizer.git", from: "1.1.2")

GTForceTouchGestureRecognizer

CI Status Coverage Status Version License Platform

Requirements

iOS 10 is required.

Installation

CocoaPods

GTForceTouchGestureRecognizer is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "GTForceTouchGestureRecognizer"

Swift Package Manager

You can use The Swift Package Manager to install GTForceTouchGestureRecognizer by adding the proper description to your Package.swift file:

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 is still in early design and development, for more information checkout its GitHub Page

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.

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.

GitHub

link
Stars: 7
Last commit: 4 years ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

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