Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zoonooz/ZFDragableModalTransition
Custom animation transition for present modal view controller
https://github.com/zoonooz/ZFDragableModalTransition
animation ios objective-c transition
Last synced: about 1 month ago
JSON representation
Custom animation transition for present modal view controller
- Host: GitHub
- URL: https://github.com/zoonooz/ZFDragableModalTransition
- Owner: zoonooz
- License: mit
- Created: 2014-05-24T04:02:39.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2018-01-21T03:49:25.000Z (almost 7 years ago)
- Last Synced: 2024-11-26T11:04:56.448Z (about 2 months ago)
- Topics: animation, ios, objective-c, transition
- Language: Objective-C
- Homepage:
- Size: 3.49 MB
- Stars: 2,468
- Watchers: 62
- Forks: 308
- Open Issues: 23
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ios - ZFDragableModalTransition - Custom animation transition for present modal view controller. (UI / Transition)
- awesome-mobile-ui - zoonooz/ZFDragableModalTransition
- awesome-ios-star - ZFDragableModalTransition - Custom animation transition for present modal view controller. (UI / Transition)
- project-awesome - zoonooz/ZFDragableModalTransition - Custom animation transition for present modal view controller (Objective-C)
README
# ZFDragableModalTransition
[![Version](https://img.shields.io/cocoapods/v/ZFDragableModalTransition.svg?style=flat)](http://cocoadocs.org/docsets/ZFDragableModalTransition)
[![License](https://img.shields.io/cocoapods/l/ZFDragableModalTransition.svg?style=flat)](http://cocoadocs.org/docsets/ZFDragableModalTransition)
[![Platform](https://img.shields.io/cocoapods/p/ZFDragableModalTransition.svg?style=flat)](http://cocoadocs.org/docsets/ZFDragableModalTransition)## Usage
```objc
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
TaskDetailViewController *detailViewController = segue.destinationViewController;
detailViewController.task = sender;// create animator object with instance of modal view controller
// we need to keep it in property with strong reference so it will not get release
self.animator = [[ZFModalTransitionAnimator alloc] initWithModalViewController:detailViewController];
self.animator.dragable = YES;
self.animator.direction = ZFModalTransitonDirectionBottom;
[self.animator setContentScrollView:detailViewController.scrollview];// set transition delegate of modal view controller to our object
detailViewController.transitioningDelegate = self.animator;// if you modal cover all behind view controller, use UIModalPresentationFullScreen
detailViewController.modalPresentationStyle = UIModalPresentationCustom;
}
```
###ScrollView
If you have scrollview in the modal and you want to dismiss modal by drag it, you need to set scrollview to ZFModalTransitionAnimator instance.
```objc
[self.animator setContentScrollView:detailViewController.scrollview];
```###Direction
You can set that which direction will our modal present. (default is ZFModalTransitonDirectionBottom)
```objc
self.animator.direction = ZFModalTransitonDirectionBottom;
```
P.S. Now you can set content scrollview only with ZFModalTransitonDirectionBottom## Requirements
- iOS >= 7.1
- ARC## Installation
ZFDragableModalTransition is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:pod "ZFDragableModalTransition"
## FAQ
### How can I show modal only part of view ?
The current ViewController's view still visible behind the modal, so you just set transparent color to background view.## Author
Amornchai Kanokpullwad, [@zoonref](https://twitter.com/zoonref)
## Swift Version
by @dimohamdy [ZFDragableModalTransitionSwift](https://github.com/dimohamdy/ZFDragableModalTransitionSwift)
## License
ZFDragableModalTransition is available under the MIT license. See the LICENSE file for more info.