ZFDragableModalTransition@kennygunie 0.3

ZFDragableModalTransition@kennygunie 0.3

测试已测试
Lang语言 Obj-CObjective C
许可证 MIT
释放最后发布2015年1月

Kien NGUYEN维护。



  • Amornchai Kanokpullwad 和 Kien NGUYEN

ZFDragableModalTransition

使用说明

- (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;
    detailViewController.modalPresentationStyle = UIModalPresentationCustom;
}

ScrollView

如果您的模态视图中包含可滚动的视图,并且您想通过拖拽来关闭模态视图,则需要将可滚动的视图设置到 ZFModalTransitionAnimator 实例中。

[self.animator setContentScrollView:detailViewController.scrollview];

方向

您可以设置模态视图以何种方向出现。(默认为 ZFModalTransitonDirectionBottom)

self.animator.direction = ZFModalTransitonDirectionBottom;

备注:现在您只能使用 ZFModalTransitonDirectionBottom 来设置内容滚动视图。

要求

  • iOS >= 7.0(在 ios8 测试版上进行了测试)
  • ARC

安装

作者

Amornchai Kanokpullwad,[email protected]

许可证

ZFDragableModalTransition 在 MIT 许可证下可用。有关更多信息,请参阅 LICENSE 文件。