动画的block使用实例

1、block的功能是实现代码的回调,简单高效

[UIView animateWithDuration:1.0 animations:^{

        //需要执行的代码

        self.cover.alpha = 0.0;

        self.imageBtn.frame = CGRectMake(85, 80, 150, 150);

        

    } completion:^(BOOL finished) {

        //动画执行完毕执行的代码

        [self.cover removeFromSuperview];

        self.cover = nil;

        

    }];

posted @ 2014-11-07 23:52  斐济的夜光  阅读(151)  评论(0编辑  收藏  举报