ZFDragableModalTransition

Custom animation transition for present modal view controller

Github星跟蹤圖

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.

[self.animator setContentScrollView:detailViewController.scrollview];

###Direction
You can set that which direction will our modal present. (default is ZFModalTransitonDirectionBottom)

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.

主要指標

概覽
名稱與所有者zoonooz/ZFDragableModalTransition
主編程語言Objective-C
編程語言Objective-C (語言數: 2)
平台
許可證MIT License
所有者活动
創建於2014-05-24 04:02:39
推送於2018-01-21 03:49:25
最后一次提交2016-10-02 16:06:58
發布數7
最新版本名稱0.6 (發布於 2015-12-30 14:47:40)
第一版名稱0.1 (發布於 2014-05-25 18:34:57)
用户参与
星數2.5k
關注者數61
派生數308
提交數69
已啟用問題?
問題數61
打開的問題數20
拉請求數8
打開的拉請求數3
關閉的拉請求數11
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?