惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 司徒正美
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
V2EX
MongoDB | Blog
MongoDB | Blog
博客园 - 叶小钗
博客园 - 三生石上(FineUI控件)
D
Docker
S
Secure Thoughts
B
Blog
M
MIT News - Artificial intelligence
P
Privacy International News Feed
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
A
Arctic Wolf
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
S
SegmentFault 最新的问题
WordPress大学
WordPress大学
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
T
Tenable Blog
Last Week in AI
Last Week in AI
A
About on SuperTechFans
T
Tor Project blog
Microsoft Azure Blog
Microsoft Azure Blog
Hugging Face - Blog
Hugging Face - Blog
月光博客
月光博客
L
Lohrmann on Cybersecurity
Security Latest
Security Latest
P
Proofpoint News Feed
有赞技术团队
有赞技术团队
P
Privacy & Cybersecurity Law Blog
Spread Privacy
Spread Privacy
AWS News Blog
AWS News Blog
P
Proofpoint News Feed
云风的 BLOG
云风的 BLOG
小众软件
小众软件
宝玉的分享
宝玉的分享
量子位
Forbes - Security
Forbes - Security
T
Threatpost
Google DeepMind News
Google DeepMind News
T
Threat Research - Cisco Blogs
H
Help Net Security
Help Net Security
Help Net Security
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
F
Full Disclosure
Hacker News: Ask HN
Hacker News: Ask HN
T
Troy Hunt's Blog
SecWiki News
SecWiki News
I
InfoQ
C
Cyber Attacks, Cyber Crime and Cyber Security
Stack Overflow Blog
Stack Overflow Blog

博客园 - 清风徐来,水波不兴

健康同步专家 隐私政策 健康同步专家介绍 IOS动画实现(2)ImageView自带动画 IOS动画实现(1)几种实现方式 学习CEGUI亟待解决问题二:消息事件传递机制问题 学习CEGUI亟待解决问题一:文本控件的格式问题 第一讲 ERP初阶(四):MRP基本构成 ERP初阶(三):MRP基本原理 ERP初阶(二):ERP概念与历程 ERP初阶(一):走近ERP 协议开发 中移动CMPP2.0协议API(四) 协议开发 中移动CMPP2.0协议API(二) 协议开发 中移动CMPP2.0协议API(三) 协议开发 中移动CMPP2.0协议API(一) 短信网关简介 SP 短信开发-PROVISION接口实现-反向取消实例代码 SP 短信开发-PROVISION接口实现-正向订购实例代码 SP 短信开发-PROVISION接口实现1
IOS动画实现(3)UIView封装的动画
清风徐来,水波不兴 · 2015-10-16 · via 博客园 - 清风徐来,水波不兴

苹果官网文档

UIView触发动画的方式分为两类,打开UIView.h头文件可以看到两个UIView的Category,

@interface UIView(UIViewAnimation) 以及 @interface UIView(UIViewAnimationWithBlocks)

两种动画的方式就在此了。姑且命名为commit方式block方式。两种实现方式,效果大同小异,只是代码实现不同而已。

文档里面描述的,可以动画起来的属性有以下七种

@"frame",@"bounds",@"center",@"transform",@"alpha",@"backgroundColor",@"contentStretch"

也各自提供了一些特效的接口。

比如:

需要重复动画commit方式有提供setAnimationRepeatCount,而block方式有UIViewAnimationOptionRepeat。

finish的回掉commit方式有setAnimationDidStopSelector,而block方式设置finish的block即可。

相应的stopAnimation,也都可以通过[view.layer removeAllAnimations]来实现

对应的代码在github上有。地址如下:

https://github.com/boboxu/ios