DismissGestureRecognizer which supports to add a GestureRecognizer for Dismissing UIViewController, the gesture takes effect when a single view controller which isn't in navigationViewController or as a firstViewController in navigationViewController. Compatible with both Swift and Objective-C.
pod 'DismissGestureRecognizer'
github "janlionly/DismissGestureRecognizer"
Package.swift
:.package(url: "https://github.com/janlionly/DismissGestureRecognizer.git", .upToNextMajor(from: "1.0.1")),
Just one line code to enable the gesture for dismissing view controller:
override func viewDidLoad() {
super.viewDidLoad()
// types: .swipeRightForLeftEdgeScreen, .panRightForLeftEdgeScreen, .disableGesture
dismissType = .swipeRightForLeftEdgeScreen
}
Attention: if set the viewController's modalPresentationStyle is .fullScreen or .currentContext, when dismissing viewController with the gesture, you cann't see the source viewController, replace it with a black background, so if you want to see the source viewController, please set modalPresentationStyle to other styles.
Visit my github: janlionly
Contact with me by email: [email protected]
I would love you to contribute to DismissGestureRecognizer
DismissGestureRecognizer is available under the MIT license. See the LICENSE file for more info.
link |
Stars: 1 |
Last commit: 3 years ago |
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics