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

推荐订阅源

Cyberwarzone
Cyberwarzone
C
CXSECURITY Database RSS Feed - CXSecurity.com
C
CERT Recently Published Vulnerability Notes
The Hacker News
The Hacker News
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Security Archives - TechRepublic
Security Archives - TechRepublic
Google Online Security Blog
Google Online Security Blog
D
Docker
H
Hacker News: Front Page
Recent Announcements
Recent Announcements
GbyAI
GbyAI
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
P
Proofpoint News Feed
Security Latest
Security Latest
AI
AI
I
InfoQ
Google DeepMind News
Google DeepMind News
阮一峰的网络日志
阮一峰的网络日志
S
Secure Thoughts
Attack and Defense Labs
Attack and Defense Labs
P
Proofpoint News Feed
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Scott Helme
Scott Helme
N
News | PayPal Newsroom
Y
Y Combinator Blog
V
Visual Studio Blog
Latest news
Latest news
大猫的无限游戏
大猫的无限游戏
Microsoft Security Blog
Microsoft Security Blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
WordPress大学
WordPress大学
V
Vulnerabilities – Threatpost
C
Cyber Attacks, Cyber Crime and Cyber Security
TaoSecurity Blog
TaoSecurity Blog
S
Security @ Cisco Blogs
D
DataBreaches.Net
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
N
Netflix TechBlog - Medium
T
Troy Hunt's Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
H
Heimdal Security Blog
美团技术团队
S
Securelist
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
S
Security Affairs
T
Threat Research - Cisco Blogs
Webroot Blog
Webroot Blog
G
Google Developers Blog
aimingoo的专栏
aimingoo的专栏

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

健康同步专家 隐私政策 健康同步专家介绍 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