https://github.com/younatics/dismissable
⚡️Dismissable is super convenient to dismiss with gesture!
https://github.com/younatics/dismissable
Last synced: 4 months ago
JSON representation
⚡️Dismissable is super convenient to dismiss with gesture!
- Host: GitHub
- URL: https://github.com/younatics/dismissable
- Owner: younatics
- License: mit
- Created: 2019-02-03T12:50:57.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-03-22T03:21:13.000Z (over 6 years ago)
- Last Synced: 2024-03-14T17:31:58.942Z (over 1 year ago)
- Language: Swift
- Homepage:
- Size: 2.79 MB
- Stars: 306
- Watchers: 6
- Forks: 16
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Dismissable
[](http://cocoapods.org/pods/Dismissable)
[](https://github.com/Carthage/Carthage)
[](https://github.com/younatics/Dismissable/blob/master/LICENSE)
[](http://cocoapods.org/pods/Triangulation)
[](https://developer.apple.com/swift/)## Introduction
⚡️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](http://cocoapods.org). To install
it, simply add the following line to your Podfile:```ruby
pod 'Dismissable'
```
### Carthage
```
github "younatics/Dismissable"
```## Usage
Conform `DismissTriggerUsable` where present modal ViewController
```swift
class ViewController: UIViewController, DismissTriggerUsable
```
Conform `DismissableUsable` in modal ViewController
```swift
class DetailViewController: UIViewController, DismissableUsable
```
Add `dismissable` when prsent modal view
```swift
let vc = UIStoryboard.init(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "detail") as! DetailViewController
vc.setup(self)
self.present(vc, animated: true, completion: nil)
```Also you can customize dismiss animator
```swift
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](https://twitter.com/younatics)## License
Dismissable is available under the MIT license. See the LICENSE file for more info.