WWDC2013_218 内容概要 ( 1 )

这篇博客是关于WWDC2013_218视频的内容概要,主要介绍了使用视图控制器进行自定义过渡动画的方法,包括:块级UIView动画API、弹簧动画、关键帧动画、快照API以及UIKit Dynamics。内容详细解释了各种动画API的用法,如设置动画启用、无动画操作、弹簧效果、关键帧动画和视图快照的创建。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

WWDC2013_218 —— 

Custom Transitions Using View Controllers ( 1 )


官方视频地址:https://developer.apple.com/wwdc/videos/

此文为自己总结的官方视频的内容概要,正在学习ing...


New animation tools

1. The block based UIView animation API ( iOS 4 )

[UIView animationWithDuration:delay:options:animations:^{

// update properties

} completion: nil];

TIPS:

Views are layer backed in UIKit, and on iOS for that matter, and as you update those properties, the various properties are kind of updated at the layer level.

And when you're in that block, core animation objects get added to the layer, and that's actually what's driving the animations that you see throughout iOS.

+ (void)setAnimationsEnabled:(BOOL) //This API has a little bit of problems (*what?)

+ (void)performWithoutAnimation:(void ^(void))actions;


2. Spring animations

solutions to single dimensional harmonic oscillators.

+ (void)animateWithDuration:(NSTimeInterval)duration

                              delay:(NSTimeInterval)delay

            usingSpringWithDamping:(CGFloat)dampingRatio//  0.0 < dampingRatio < = 1.0

              initialSpringVelocity:(CGFloat)velocity

                         options:(UIViewAnimationOptions)options

                  animations:(void (^)(void))animations

                         completion:(void (^)(BOOL finished))completion;


3. Key-frame animations

is to CAKeyframeAnimation

+ (void)animateKeyframesWithDuration:(NSTimeInterval)duration

                     delay:(NSTimeInterval)delay

                      options:(UIViewKeyframeAnimationOptions)options

              animations:(void (^)(void))animations

              completion:(void (^)(BOOL finished))completion;

+ (void)addKeyframeWithRelativeStartTime:(double)frameStartTime

                           relativeDuration:(double)frameDuration

                               animations:(void (^)(void))animations

[UIView animateKeyframesWithDuration: .35

        delay: 0.0

      options: 0

        animations: ^{

/*

Those add key frames are actually the key frame values of the particular property most likely, 

or they could be multiple properties at different points in the animation.

*/

     [UIView addKeyframe... animations: ^{...}];

     [UIView addKeyframe... animations:^{...}];

     [UIView addKeyframe... animations:^{

     [someView setPosition:...];

// etc. }];

}

      completion: ^(BOOL finished) {...}];


4. Snapshot API

- (UIView *)[UIView snapshotView]

- (UIView *)[UIView resizableSnapshotViewFromRect:(CGRect)rect

  withCapInsets:(UIEdgeInsets)capInsets

TIPS:

When you create a snapshot,  you can create snapshots of snapshots.


5. UIKit Dynamics

Distinct from UIView animation APIs


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值