#import "UIImageView+shopCar_animation.h"
@implementation UIImageView (shopCar_animation)
-(void)shopCar_animtion_frame:(CGPoint) center end_block:(void(^)())block
{
UIView * views = [UIApplication sharedApplication].delegate.window;
CGPoint point = [views convertPoint:self.center fromView:self];
UIImageView * image = [[UIImageView alloc]initWithFrame:self.bounds];
image.backgroundColor = [UIColor redColor];
image.image = self.image;
image.center = point;
[views addSubview:image];
[UIView animateWithDuration:.5 animations:^{
image.center = center;
CGAffineTransform transform = CGAffineTransformScale(image.transform, .1, .1);
image.transform =transform;
} completion:^(BOOL finished) {
if (block) {
block();
}
[image removeFromSuperview];
}];
}
@end
网友评论