Swiftpack.co - janlionly/DismissGestureRecognizer as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by janlionly.
janlionly/DismissGestureRecognizer 1.0.1
Add a GestureRecognizer for Dismissing UIViewController
⭐️ 1
🕓 3 years ago
.package(url: "https://github.com/janlionly/DismissGestureRecognizer.git", from: "1.0.1")

DismissGestureRecognizer

Version Carthage Compatible License Platform Swift

Description

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.

Installation

CocoaPods

pod 'DismissGestureRecognizer'

Carthage

github "janlionly/DismissGestureRecognizer"

Swift Package Manager

.package(url: "https://github.com/janlionly/DismissGestureRecognizer.git", .upToNextMajor(from: "1.0.1")),

Usage

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.

Requirements

  • iOS 8.0+
  • Swift 4.2 to 5.2

Author

Visit my github: janlionly
Contact with me by email: [email protected]

Contribute

I would love you to contribute to DismissGestureRecognizer

License

DismissGestureRecognizer is available under the MIT license. See the LICENSE file for more info.

GitHub

link
Stars: 1
Last commit: 3 years ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

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