Use PanGesture to dismiss view on UIViewController and UIView.
left to right | right to left | top to bottom | bottom to top |
---|---|---|---|
left to right | right to left | top to bottom | bottom to top |
---|---|---|---|
// UIViewController
let viewController = UIViewController()
viewController.enablePanSlip(direction: .topToBottom, percentThreshold: 0.2) {
// TODO completion when UIViewController dismissed
}
// UIView
let view = UIView()
view.enablePanSlip(direction: .topToBottom, percentThreshold: 0.2) {
// TODO completion when UIView dismissed
}
// UIViewController
let viewController = UIViewController()
viewController.disablePanSlip()
// UIView
let view = UIView()
view.disablePanSlip()
platform :ios, '8.0'
use_frameworks!
target '<Your Target Name>' do
pod 'PanSlip'
end
github "k-lpmg/PanSlip"
These works are available under the MIT license. See the LICENSE file for more info.