Latest 0.0.2
Homepage https://github.com/shingt/DraggableModalTransition
License MIT
Platforms ios 9.0
Authors

CI Status
Version
License
Xcode 8.2+
iOS 9.0+
Swift 3.0+

Introduction

DraggableModalTransition enables dragging interaction and animation of scrollView in a similar way to Facebook Messenger app.
Inspired by zoonooz/ZFDragableModalTransition. Key difference is you can continue dragging scrollView after you have finished scrolling to top of it (See example below).

Example

DraggableModalTransition

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.

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.

class ModalViewController {
    weak var modalViewControllerDelegate: ModalViewControllerDelegate?
    ...
    func scrollViewDidScroll(_ scrollView: UIScrollView) {
        modalViewControllerDelegate?.modalViewDidScroll(scrollView)
    }
} 

See example project for more details.

Requirements

  • iOS9+
  • Swift 3.0+
  • Xcode 8.0+

Installation

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

pod "DraggableModalTransition"

Author

shingt

License

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

Latest podspec

{
    "name": "DraggableModalTransition",
    "version": "0.0.2",
    "summary": "Enables dragging interaction similar to Facebook Messenger app",
    "description": "DraggableModalTransition enables dragging interaction and animation of scrollView in a similar way to Facebook Messenger app.",
    "homepage": "https://github.com/shingt/DraggableModalTransition",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "shingt": "[email protected]"
    },
    "source": {
        "git": "https://github.com/shingt/DraggableModalTransition.git",
        "tag": "0.0.2"
    },
    "platforms": {
        "ios": "9.0"
    },
    "source_files": "Sources/*",
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This