弹出动画
//出现
- (void)showAnimal{
self.transform = CGAffineTransformScale(CGAffineTransformIdentity, CGFLOAT_MIN, CGFLOAT_MIN);
[UIView animateWithDuration:0.3 animations:^{
// 以动画的形式将view慢慢放大至原始大小的1.2倍
self.transform = CGAffineTransformScale(CGAffineTransformIdentity, 1.2, 1.2);
} completion:^(BOOL finished) {
[UIView animateWithDuration:0.2 animations:^{
// 以动画的形式将view恢复至原始大小
self.transform = CGAffineTransformIdentity;
}];
}];
}
//隐藏
- (void)hiddenView{
[UIView animateWithDuration:0.2 animations:^{
self.transform = CGAffineTransformScale(CGAffineTransformIdentity, 1.2, 1.2);
} completion:^(BOOL finished) {
[UIView animateWithDuration:0.3 animations:^{
self.transform = CGAffineTransformScale(CGAffineTransformIdentity, 0.001, 0.001);
} completion:^(BOOL finished) {
[self removeFromSuperview];
}];
}];
}