PanSlip
  • December 4, 2023

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”

GitHub


View Github

#dismiss #dismissible #pangesture #uiview #uiviewcontroller
YOU MIGHT ALSO LIKE...
CameraBackground

Features Both front and back camera supported. Flash modes: auto, on, off. Countdown timer. Tap to focus. Pinch to zoom. Usage  

DKCamera

Description A light weight & simple & easy camera for iOS by Swift. It uses CoreMotion framework to detect device orientation, so ...

HorizonSDK-iOS

Horizon SDK is a state of the art real-time video recording / photo shooting iOS library. Some of the features ...

LLSimpleCamera

LLSimpleCamera: A simple customizable camera - video recorder control LLSimpleCamera is a library for creating a customized camera - video ...

RSBarcodes_Swift

RSBarcodes allows you to read 1D and 2D barcodes using the metadata scanning capabilities introduced with iOS 7 and generate ...