Skip to content
Use PanGesture to dismiss view on UIViewController and UIView
Branch: master
Clone or download
Latest commit 72dddac Jun 27, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Example Bump version to 1.3.3 Jun 27, 2019
PanSlip.xcodeproj Add PanSlipBehavior Jun 19, 2019
Sources/PanSlip Fix unconfigure logic issue in PanSlip+UIView Jun 27, 2019
.gitignore Initial commit Jun 11, 2019
.travis.yml Add .travis.yml Jun 14, 2019
Info.plist Bump version to 1.3.3 Jun 27, 2019
LICENSE Initial commit Jun 11, 2019
PanSlip.h Initial commit Jun 11, 2019
PanSlip.podspec Bump version to 1.3.3 Jun 27, 2019
README.md Update README.md Jun 27, 2019

README.md

PanSlip

Build Status Swift Cocoapods Carthage compatible Platform License

Use PanGesture to dismiss view on UIViewController and UIView.

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.

You can’t perform that action at this time.