[UIView animateWithDuration:0.25 animations:^{
// 3.1.阴影慢慢显示出来
cover.alpha = 0.7;
// 3.2.头像慢慢变大,慢慢移动到屏幕的中间
CGFloat iconW = self.view.frame.size.width;
CGFloat iconH = iconW;
CGFloat iconY = (self.view.frame.size.height - iconH) * 0.5;
self.iconBtn.frame = CGRectMake(0, iconY, iconW, iconH);
}];
[UIView animateWithDuration:0.25 animations:^{
// 存放需要执行动画的代码
// 1.头像慢慢变为原来的位置和尺寸
self.iconBtn.frame = CGRectMake(85, 80, 150, 150);
// 2.阴影慢慢消失
self.cover.alpha = 0.0;
} completion:^(BOOL finished) {
// 动画执行完毕后会自动调用这个block内部的代码
// 3.动画执行完毕后,移除遮盖(从内存中移除)
[self.cover removeFromSuperview];
self.cover = nil;
}];