Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shingt/draggablemodaltransition
Enables dragging interaction and animation of scrollView in a similar way to Facebook Messenger app.
https://github.com/shingt/draggablemodaltransition
animation ios scrollview swift uitableview
Last synced: 4 months ago
JSON representation
Enables dragging interaction and animation of scrollView in a similar way to Facebook Messenger app.
- Host: GitHub
- URL: https://github.com/shingt/draggablemodaltransition
- Owner: shingt
- License: mit
- Created: 2017-01-29T09:31:33.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2019-02-02T12:24:28.000Z (about 6 years ago)
- Last Synced: 2024-10-03T16:17:06.356Z (5 months ago)
- Topics: animation, ios, scrollview, swift, uitableview
- Language: Swift
- Homepage:
- Size: 1.66 MB
- Stars: 63
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# DraggableModalTransition
[](https://www.bitrise.io/app/774d809f168e4285)
[](http://cocoapods.org/pods/DraggableModalTransition)
[](http://cocoapods.org/pods/DraggableModalTransition)


## Introduction
DraggableModalTransition enables dragging interaction and animation of scrollView in a similar way to Facebook Messenger app.
Inspired by [zoonooz/ZFDragableModalTransition](https://github.com/zoonooz/ZFDragableModalTransition). Key difference is you can **continue dragging scrollView after you have finished scrolling to top of it** (See example below).## Example
Example project is available at `Example/DraggableModalTransition.xcodeproj`.
## Usage
Set an instance of `DraggableModalTransition` to `transitioningDelegate` of viewController you want to present.
Note that you have to keep an instance of `DraggableModalTransition` even after view is presented.```swift
func presentModalView() {
let controller = ModalViewController()
let navigationController = UINavigationController(rootViewController: controller)
modalTransition = DraggableModalTransition(with: controller)
navigationController.transitioningDelegate = modalTransition
controller.modalViewControllerDelegate = modalTransition
present(navigationController, animated: true, completion: nil)
}
```For now you also need to call `modalViewDidScroll` in your `scrollViewDidScroll`.
```swift
class ModalViewController {
weak var modalViewControllerDelegate: ModalViewControllerDelegate?
...
func scrollViewDidScroll(_ scrollView: UIScrollView) {
modalViewControllerDelegate?.modalViewDidScroll(scrollView)
}
}
```See example project for more details.
## Requirements
* iOS9+
* Swift 4.2+
* Xcode 10.0+## Installation
DraggableModalTransition is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:```ruby
pod "DraggableModalTransition"
```## Author
shingt
## License
DraggableModalTransition is available under the MIT license. See the LICENSE file for more info.