Profile
Back to NewsBack
GitHub Trending 2 min
Reader Mode
younatics/Dismissable: ⚡️Dismissable is super convenient to dismiss with gesture!

younatics/Dismissable: ⚡️Dismissable is super convenient to dismiss with gesture!

10 hours ago

Dismissable

Swift Package Manager</a> CocoaPods</a> Platform</a> Swift 6.0</a> License: MIT</a>

Introduction

⚡️Pull to dismiss your modal view! Dismissable is super convenient to dismiss with gesture!

!demo

Requirements

Dismissable requires iOS 13.0 or later and Swift 6.0 with Swift tools version 6.0. Supports Swift Package Manager and CocoaPods.

Installation

Swift Package Manager

In Xcode, choose File ▸ Add Package Dependencies… and enter:

https://github.com/younatics/Dismissable.git

Or add it to your Package.swift:

dependencies: [
    .package(url: "https://github.com/younatics/Dismissable.git", from: "2.0.0")
]

CocoaPods

Dismissable is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'Dismissable', '2.0.0'

Usage

Conform DismissTriggerUsable in the view controller that presents the modal view controller:

class ViewController: UIViewController, DismissTriggerUsable
Conform DismissableUsable in the modal view controller:
class DetailViewController: UIViewController, DismissableUsable
Call setup(_:) before presenting the modal view controller:
var vc = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "detail") as! DetailViewController
vc.setup(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
 }()

References

Please tell me or make pull request if you use this library in your application :)

Author

younatics Twitter

License

Dismissable is available under the MIT license. See the LICENSE file for more info.
Our Related Projects
Farm Fresh Kikapu

An e-commerce platform for farm-fresh produce - an online st...

View Project
Chat with me