渐变动画

第一种 头尾式(现在苹果官方以经废弃):

// 开始动画

[UIView beginAnimations:nil context:nil];

// 设置动画时间

[UIView setAnimationDuration:2.0];

/* 需要执行动画的代码 */

// 提交动画

[UIView commitAnimations];

第二种 block式:

// 1.5s后,再执行动画(动画持续2s)

[UIView animateWithDuration:2.0 delay:1.5 options:kNilOptions animations:^{

    /* 需要执行动画的代码 */

} completion:nil]

)
原文地址:https://www.cnblogs.com/wwjwb/p/12650370.html