动画感想,清理未用resource的第三方工具
经常会看到有很多app,在画面推出来之后,才陆陆续续将模块通过动画展现出来,今天终于知道怎么做出来的了.
1.由于是画面出来之后才有的动画,所以应该在viewdidappear里面去实现这些代码
2.动画代码
<1>控件的反转
[UIView animateWithDuration:1.0 animations:^{
self.closeBtn.transform = CGAffineTransformMakeRotation(M_PI);
}];
<2>控件的左推出或者右推出或者从中间向两边展开
-(void)setupAnimationWithStartRect:(CGRect)startRect endRect:(CGRect)endRect object:(UIView *)view duration:(NSTimeInterval)duration {
UIBezierPath *beginPath = [UIBezierPath bezierPathWithRect:startRect];
UIBezierPath *endPath = [UIBezierPath bezierPathWithRect:endRect];
CAShapeLayer *quickMask = [[CAShapeLayer alloc]init];
quickMask.path = endPath.CGPath;
quickMask.fillColor = [UIColor whiteColor].CGColor;
view.layer.mask = quickMask;
CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"path"];
animation.duration = duration;
animation.beginTime = CACurrentMediaTime();
animation.fromValue = (__bridge id _Nullable)(beginPath.CGPath);
animation.toValue = (__bridge id _Nullable)(endPath.CGPath);
[quickMask addAnimation:animation forKey:@"path"];
}
<3>控件掉下伴随重力反弹
self.topConstraint.constant = 40;
self.leftlineWidth.constant = 103;
self.rightlineWidth.constant = 103;
[UIView animateWithDuration:1.0 delay:0.5 usingSpringWithDamping:0.3 initialSpringVelocity:0 options:UIViewAnimationOptionCurveEaseIn animations:^{
[self.view layoutIfNeeded];
} completion:^(BOOL finished) {
}
2.这个第三方工具名字叫做LSUnusedResource
可以清理工程中一些未用的图片素材