iOS视图动画效果 CPAnimationSequence

码农软件 · 软件分类 · 图形/图像处理 · 2019-09-08 07:13:36

软件介绍

编写iOS视图UIView的动画效果需要很多代码,虽然iOS 4支持块定义,对视图动画的定义减少了不少代码,但语法依旧不好看。CPAnimationSequence是一个开源代码库,可以一种间接快捷的方式来定义描述动画队列,克服了写繁多的代码。

下面一个使用例子:
CPAnimationSequence* shakespeare = [CPAnimationSequence sequenceWithSteps:
    [CPAnimationStep           for:0.2 animate:^{ self.romeo.alpha = 1.0; }],
    [CPAnimationStep           for:0.2 animate:^{ self.julia.alpha = 1.0;  }],
    [CPAnimationStep after:1.0 for:0.7 animate:^{
                            CGPoint love = CGPointMake((self.romeo.center.x + self.julia.center.x)/2,
                                                       (self.romeo.center.y + self.julia.center.y)/2);
                            self.romeo.center = love;
                            self.julia.center = love;
    }],
    [CPAnimationStep after:2.0 for:0.5 animate:^{ self.romeo.alpha = 0.0;
                                                  self.julia.alpha = 0.0; }]
    nil];
[shakespeare run];

本文地址:https://www.codercto.com/soft/d/14121.html

Domain-Driven Design Distilled

Domain-Driven Design Distilled

Vaughn Vernon / Addison-Wesley Professional / 2016-6-2 / USD 36.99

Domain-Driven Design (DDD) software modeling delivers powerful results in practice, not just in theory, which is why developers worldwide are rapidly moving to adopt it. Now, for the first time, there......一起来看看 《Domain-Driven Design Distilled》 这本书的介绍吧!

HTML 编码/解码
HTML 编码/解码

HTML 编码/解码

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具