Swiftpack.co - k-lpmg/PanSlip as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by k-lpmg.
k-lpmg/PanSlip 1.3.3
Use PanGesture to dismiss view on UIViewController and UIView
⭐️ 100
🕓 1 week ago
.package(url: "https://github.com/k-lpmg/PanSlip.git", from: "1.3.3")

PanSlip

Build Status Swift Cocoapods Carthage compatible Platform License

Use PanGesture to dismiss view on UIViewController and UIView.

Introduction

PanSlip to UIViewController

left to right right to left top to bottom bottom to top

PanSlip to UIView

left to right right to left top to bottom bottom to top

Usage

Enable

// UIViewController
let viewController = UIViewController()
viewController.ps.enable(slipDirection: .topToBottom) {
    // TODO completion when UIViewController dismissed
}

// UIView
let view = UIView()
view.ps.enable(slipDirection: .topToBottom) {
    // TODO completion when UIView dismissed
}

Disable

// UIViewController
let viewController = UIViewController()
viewController.ps.disable()

// UIView
let view = UIView()
view.ps.disable()

Manual slip

// UIViewController
let viewController = UIViewController()
viewController.ps.slip(animated: true)

// UIView
let view = UIView()
view.ps.slip(animated: true)

Set percentThreshold

// UIViewController
extension UIViewController: PanSlipBehavior {
    public var percentThreshold: CGFloat? {
        return 0.2
    }
}

// UIView
extension UIView: PanSlipBehavior {
    public var percentThreshold: CGFloat? {
        return 0.2
    }
}

Installation

CocoaPods (iOS 8+)

platform :ios, '8.0'
use_frameworks!

target '<Your Target Name>' do
    pod 'PanSlip'
end

Carthage (iOS 8+)

github "k-lpmg/PanSlip"

LICENSE

These works are available under the MIT license. See the LICENSE file for more info.

GitHub

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

Release Notes

3 years ago

Fix unconfigure issue in PanSlip+UIView

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