在iOS9 中,如果进行animateWithDuration 时,view被release 那么会引起crash。
[UIView animateWithDuration:0.25f animations:^{
self.frame = selfFrame;
} completion:^(BOOL finished) {
if (finished) {
[super removeFromSuperview];
}
}];
应该这样处理:
[UIView animateWithDuration:0.25f
delay:0
usingSpringWithDamping:1.0
initialSpringVelocity:1.0 options:UIViewAnimationOptionCurveLinear
animations:^{
self.frame = selfFrame;
} completion:^(BOOL finished) {
[super removeFromSuperview];
}];