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

推荐订阅源

Google DeepMind News
Google DeepMind News
D
Darknet – Hacking Tools, Hacker News & Cyber Security
T
Threat Research - Cisco Blogs
G
GRAHAM CLULEY
The Hacker News
The Hacker News
S
Securelist
K
Kaspersky official blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
AWS News Blog
AWS News Blog
H
Hacker News: Front Page
P
Privacy & Cybersecurity Law Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
N
News | PayPal Newsroom
Project Zero
Project Zero
H
Heimdal Security Blog
TaoSecurity Blog
TaoSecurity Blog
The Cloudflare Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
T
Tenable Blog
The Last Watchdog
The Last Watchdog
大猫的无限游戏
大猫的无限游戏
C
Check Point Blog
S
Schneier on Security
云风的 BLOG
云风的 BLOG
P
Proofpoint News Feed
月光博客
月光博客
博客园_首页
V
Visual Studio Blog
宝玉的分享
宝玉的分享
IT之家
IT之家
PCI Perspectives
PCI Perspectives
MyScale Blog
MyScale Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
T
Troy Hunt's Blog
F
Fortinet All Blogs
U
Unit 42
Help Net Security
Help Net Security
Recent Commits to openclaw:main
Recent Commits to openclaw:main
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
J
Java Code Geeks
aimingoo的专栏
aimingoo的专栏
Jina AI
Jina AI
L
LINUX DO - 热门话题
NISL@THU
NISL@THU
MongoDB | Blog
MongoDB | Blog
G
Google Developers Blog
人人都是产品经理
人人都是产品经理
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - Franky

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

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