Coder Social home page Coder Social logo

hgtransitionanimator's Introduction

HGTransitionAnimator

如何使用

###导入头文件 #import "UIViewController+HGAnimator.h"

###Present方法

OneViewController *oneVC=[[OneViewController alloc]init];
	[self hg_presentViewController:oneVC animateStyle:HGTransitionAnimatorFromLeftStyle  delegate:self presentFrame:_presentFrame backgroundColor:_backgroundColor animated:YES];

###Dismiss方法

[self hg_dismissViewControllerAnimated:YES completion:nil];

###自定义需要做的:

实现HGTransitionAnimatorDelegate代理方法Transition
@interface ViewController ()	<HGTransitionAnimatorDelegate>
- (void)transitionAnimator:(HGTransitionAnimator *)animator animateTransitionToView:(UIView *)toView duration:(NSTimeInterval)duration{	// 弹出动画代码写在这里
}
- (void)transitionAnimator:(HGTransitionAnimator *)animator animateTransitionFromView:(UIView *)fromView duration:(NSTimeInterval)duration
{
	// 消失动画代码写在这里
}
- (NSTimeInterval)transitionDuration:(HGTransitionAnimator *)animator
{
    // 动画时间写在这里
}
- (BOOL)transitionAnimatorCanResponse:(HGTransitionAnimator *)animator
{
	// 蒙版点击是否有效
}
- (NSTimeInterval)transitionDuration:(HGTransitionAnimator *)animator
{
	//修改动画时间
}
// 更多代理方法详见demo

#项目演示 查看并运行 HGTransitionAnimator/demo ###自定义样式

	animateStyle:HGTransitionAnimatorCustomStyle

(自定义样式) ###底部弹出样式

	animateStyle:HGTransitionAnimatorFromBottomStyle

(底部弹出) ###隐藏样式

	animateStyle:HGTransitionAnimatorHiddenStyle

(隐藏样式) ###垂直压缩样式

	animateStyle:HGTransitionAnimatorVerticalScaleStyle

(垂直压缩) 系统要求

该项目最低支持 iOS 7.0Xcode 7.0

注意

支持横竖屏的切换。使用控制器管理弹出视图的好处:面向协议编程,使控制器与View之间的传递控制链转换成控制器与控制器之间的传递,降低了代码的耦合度并且提高了代码的复用率,这也是Apple推出转场控制器的用意。如QQ右上角的添加分享界面的底部弹出、都可以用自带样式定义一个专属控制器,支持。目前有11种自带的样式,基本上可以满足日常的开发需求。如果自定义,请实现HGTransitionAnimatorDelegate代理方法。

许可证

HGTransitionAnimator 使用 MIT 许可证,详情见 LICENSE 文件。

hgtransitionanimator's People

Contributors

ixixii avatar zhahao avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.