pop动画库简单使用小记
- (void)animateInView:(UIView *)view{ UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"auto_common_点赞高亮"]]; imageView.frame = view.frame; imageView.contentMode = UIViewContentModeScaleAspectFit; [self addSubview:imageView]; view.hidden = YES; POPBasicAnimation *animation = [POPBasicAnimation animationWithPropertyNamed:kPOPLayerSize]; animation.duration = 0.2; [animation setCompletionBlock:^(POPAnimation *anim, BOOL finish) { if (finish) { POPBasicAnimation *animation = [POPBasicAnimation animationWithPropertyNamed:kPOPLayerSize]; animation.duration = 0.1; [animation setCompletionBlock:^(POPAnimation *anim, BOOL finish) { if (finish) { [imageView removeFromSuperview]; view.hidden = NO; } }]; animation.toValue = [NSValue valueWithCGSize:view.lh_size]; [imageView pop_addAnimation:animation forKey:@"size"]; } }]; animation.toValue = [NSValue valueWithCGSize:CGSizeMake(40, 40)]; [imageView pop_addAnimation:animation forKey:@"size"]; }