Need help with ZFDragableModalTransition?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

zoonooz
2.5K Stars 320 Forks MIT License 69 Commits 24 Opened issues

Description

Custom animation transition for present modal view controller

Services available

!
?

Need anything else?

Contributors list

# 26,560
appbarl...
Objecti...
iOS
Xcode
46 commits
# 180,394
Objecti...
Swift
dsl
json-ap...
2 commits
# 162,299
Objecti...
Ruby
iOS
2 commits
# 100,532
Swift
custom-...
epub-re...
Objecti...
2 commits
# 59,325
appletv
swift-3
custom-...
Xcode
1 commit
# 203,186
Objecti...
Shell
altera
regress...
1 commit
# 221,851
Shell
Objecti...
Swift
iOS
1 commit

ZFDragableModalTransition

Version License Platform

Usage

- (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. 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

Swift Version

by @dimohamdy ZFDragableModalTransitionSwift

License

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

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.