IVM冬虫夏草酱示例
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了IVM冬虫夏草酱示例相关的知识,希望对你有一定的参考价值。
A snippet of code from IVM-Awesomesauce that shows how to use included classes to perform a custom animation between two UIViewControllers.
- (IBAction)leButtonTapped:(id)sender { NextViewController *nvc = [[NextViewController alloc] initWithNibName:@"NextViewController" bundle:nil] ; // This performs a flipboard-like animation ASAnimatedTransition *animatedTransition = [[ASAnimatedTransition alloc] init] ; animatedTransition.sourceView = self.view ; animatedTransition.destinationView = nvc.view ; animatedTransition.hostView = self.view ; animatedTransition.initializeAnimationBlock = ^(AnimationView *animationView, CALayer *sourceLayer, CALayer *destinationLayer) { CATransform3D transform = CATransform3DIdentity ; transform.m34 = 1.0 / -200 ; transform = CATransform3DTranslate(transform, 0, 5, -25) ; destinationLayer.transform = transform ; } ; animatedTransition.performAnimationBlock = ^(AnimationView *animationView, CALayer *sourceLayer, CALayer *destinationLayer) { [CATransaction setAnimationDuration:0.6] ; sourceLayer.position = CGPointMake(sourceLayer.position.x, -sourceLayer.frame.size.height/2.0) ; destinationLayer.transform = CATransform3DIdentity ; } ; animatedTransition.animationFinishedBlock = ^() { [self.navigationController pushViewController:nvc animated:NO] ; } ; [animatedTransition performTransition] ; }
以上是关于IVM冬虫夏草酱示例的主要内容,如果未能解决你的问题,请参考以下文章