登录 立即注册
金钱:

Code4App-iOS开发-iOS 开源代码库-iOS代码实例搜索-iOS特效示例-iOS代码例子下载-Code4App.com

ThinkVerb 超酷的枪型动画库!

[复制链接]
来自: wx_n4wM6AwA 分类: iOS精品源码 上传时间: 2019-1-28 16:52:48
Tag:

项目介绍:

详见github:https://github.com/hon-key/ThinkVerb

demo 里有示例代码,注释也比较清楚,不过我写的是英文

ThinkVerb

ThinkVerb is an Animation Interface based on CoreAnimation, it help you make CAAnimation for view's layer easily. ThinkVerb uses chain programming style to mak CAAnimation. Most of the time you just need to type one line of code to make an animation even if it is complicated. So you can do animation anywhere easily and the code is so human readable.

Usage

ThinkVerb just have one entrance,that is TVAnimation of an UIView,it is a manager of animation sprite,all you need to do is make an animation sprite using a TVAnimation and then activate it.

Take an example,if you want to rotate an UIView forever,just type:
NSString rotation = view.TVAnimation.rotate.z.endAngle(M_PI 2).repeat(-1).activate();
The code rotate your view around the z axis from current angle to endAngle, asume that the current angle is 0, your view will make a turn. repeat(-1) make this animation repeat forever. At last you just need to call activate() and the animation will automatically run.

If you want to stop rotation, most of time you just need to type:
view.TVAnimation.clear();
The action clear all animations of the view. You can also type:
view.TVAnimation.existSprite(rotation).stop();
The action stop and release the rotation animation

You can see more animation example in ThinkVerbDemo project

You can combine any animation,even like a gun:

view.TVAnimation.appearance.duration(3).timing(TVTiming.extremeEaseOut).end();
view.TVAnimation.contents.drawRange(nil,[UIImage imageNamed:@"1"]).didStop(^{
    view.TVAnimation.contents.drawRange([UIImage imageNamed:@"1"],[UIImage imageNamed:@"2"]).didStop(^{
        view.TVAnimation.contents.drawRange([UIImage imageNamed:@"2"],[UIImage imageNamed:@"3"]).didStop(^{
            view.TVAnimation.contents.drawRange([UIImage imageNamed:@"3"],[UIImage imageNamed:@"2"]).activate();
        }).activate();
    }).activate();
}).activate();

Installation

Using cocoapods

pod 'ThinkVerb'

Copy files

Copy all files from Thinkverb fold to your project

Indexes

Basic

move animate your view's position from one place to another place, position is related to anchorPoint

scale scale your view with times param

rotate rotate your view around x/y/z axis

shadow animate shadow offset/opacity/radius/color of a view,

bounds aniamte bounds of a view's layer,bounds,the effect is related to view position

anchor animate anchorPoint,normally you should animate anchor with other related animations

translate animte your view's position using offset, can be apply to sublayer

fade animate your view's opacity

contents animate bitmap of layer,using rect to animate rectangle of bitmap with range of [0 0 1 1],etc

backgroundColor aniamte background color of an UIView

cornerRadius animate cornerRadius of an UIView

border animate border's width and color of an UIView

path animate transition path of an UIView's layer

Appearance

appearance sprite is used to configure default value to all sprite of an UIView, take an example,if you want all animation keep alive when finished,you may do it like this before you make any sprite:

view.TVAnimation.appearance.keepAlive(YES).end();

License

ThinkVerb is released under the MIT license. See LICENSE for details.

相关源码推荐:

我来说两句
*滑动验证:
所有评论(5)
逆鳞九霄 2019-1-28 17:57:41
感谢分享,Code4App有你更精彩:)
回复
一人无 2019-1-28 17:57:52
不错不错,楼主辛苦了。。。
回复
android小哥 2019-1-28 17:57:58
支持,感谢,祝code4app越来越好~
回复
ff12345 2019-1-28 17:58:21
感谢大神~
回复
AlonMessi 2019-1-28 17:58:34
帮帮顶顶!!
回复
这是个逗比 2019-1-28 17:59:06
膜拜大神~
回复
littleRed 2019-1-28 17:59:25
虽不明,但觉厉...
回复
MRLiB 2019-1-29 10:09:38
淡定,淡定,淡定……
回复
code4app热心网友 2019-1-30 02:43:27
虽不明,但觉厉!
回复
提取码:  下载次数:2 状态:已购或VIP 售价:0(原价:15)金钱 下载权限:初级码农 
704 0 2
联系我们
首页/微信公众账号投稿

帖子代码编辑/版权问题

QQ:435399051,742864542

如何获得代码达人称号?

代码贡献英雄榜
用户名 下载数
通过邮件订阅最新 Code4App 信息
上一条 /4 下一条
联系我们
关闭
合作电话:
13802416937
Email:
435399051@qq.com
商务市场合作/投稿
问题反馈及帮助
联系我们

广告投放| 广东互联网违法和不良信息举报中心|中国互联网举报中心|Github|申请友链|手机版|Code4App ( 粤ICP备15117877号-1 )

快速回复 返回顶部 返回列表
博聚网