A super convenient to dismiss with gesture
Dismissable
⚡️Pull to dismiss your modal view! Dismissable
is super convenient to dismiss with gesture!
Requirements
Dismissable
is written in Swift 4.2. Compatible with iOS 9.0+
Installation
Cocoapods
Dismissable is available through CocoaPods. To install
it, simply add the following line to your Podfile:
pod 'Dismissable'
Carthage
github "younatics/Dismissable"
Usage
Conform DismissTriggerUsable
where present modal ViewController
class ViewController: UIViewController, DismissTriggerUsable
Conform DismissableUsable
in modal ViewController
class DetailViewController: UIViewController, DismissableUsable
Add dismissable
when prsent modal view
let vc = UIStoryboard.init(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "detail") as! DetailViewController
vc.setup(dismissable: (self, dismissInteractor))
self.present(vc, animated: true, completion: nil)
Also you can customize dismiss animator
var dismissAnimator: DismissAnimator = {
let animator = DismissAnimator()
animator.transitionDuration = 0.35
animator.dimmedViewStartColor = UIColor.black.withAlphaComponent(0.4)
animator.dimmedViewEndColor = UIColor.black.withAlphaComponent(0)
return animator
}()