1 # ZFDragableModalTransition
3 [![Version](https://img.shields.io/cocoapods/v/ZFDragableModalTransition.svg?style=flat)](http://cocoadocs.org/docsets/ZFDragableModalTransition)
4 [![License](https://img.shields.io/cocoapods/l/ZFDragableModalTransition.svg?style=flat)](http://cocoadocs.org/docsets/ZFDragableModalTransition)
5 [![Platform](https://img.shields.io/cocoapods/p/ZFDragableModalTransition.svg?style=flat)](http://cocoadocs.org/docsets/ZFDragableModalTransition)
7 <p align="center"><img src="https://raw.githubusercontent.com/zoonooz/ZFDragableModalTransition/master/Screenshot/ss.gif"/></p>
12 - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
14 TaskDetailViewController *detailViewController = segue.destinationViewController;
15 detailViewController.task = sender;
17 // create animator object with instance of modal view controller
18 // we need to keep it in property with strong reference so it will not get release
19 self.animator = [[ZFModalTransitionAnimator alloc] initWithModalViewController:detailViewController];
20 self.animator.dragable = YES;
21 self.animator.direction = ZFModalTransitonDirectionBottom;
22 [self.animator setContentScrollView:detailViewController.scrollview];
24 // set transition delegate of modal view controller to our object
25 detailViewController.transitioningDelegate = self.animator;
27 // if you modal cover all behind view controller, use UIModalPresentationFullScreen
28 detailViewController.modalPresentationStyle = UIModalPresentationCustom;
32 If you have scrollview in the modal and you want to dismiss modal by drag it, you need to set scrollview to ZFModalTransitionAnimator instance.
34 [self.animator setContentScrollView:detailViewController.scrollview];
38 You can set that which direction will our modal present. (default is ZFModalTransitonDirectionBottom)
40 self.animator.direction = ZFModalTransitonDirectionBottom;
42 P.S. Now you can set content scrollview only with ZFModalTransitonDirectionBottom
50 ZFDragableModalTransition is available through [CocoaPods](http://cocoapods.org). To install
51 it, simply add the following line to your Podfile:
53 pod "ZFDragableModalTransition"
57 ### How can I show modal only part of view ?
58 The current ViewController's view still visible behind the modal, so you just set transparent color to background view.
62 Amornchai Kanokpullwad, [@zoonref](https://twitter.com/zoonref)
66 ZFDragableModalTransition is available under the MIT license. See the LICENSE file for more info.