My application was working with no problem in iphone simulator, but when I run it on iphone 4 (ios 5.1) some views’ animations are not fluent and they sometimes falter. I use the code below, what might the problem be here?
- (void)moveAnimatedToPoint:(CGPoint)point after:(float)delay during:(CGFloat)duration willRemove:(BOOL)remove
{
[UIView animateWithDuration:duration
delay:delay
options:UIViewAnimationCurveEaseOut
animations:^{
self.frame = CGRectMake(point.x, point.y,
CGRectGetWidth(self.frame), CGRectGetHeight(self.frame));
} completion:^(BOOL finished) {
if (finished) {
if (remove)
[self removeFromSuperview];
else {
isHided = CGRectContainsRect(self.superview.frame, self.frame) ? NO : YES;
}
}
}];
}
Solution is explained at below link very well. My views have shadow layers and they slow the transition animations.
http://mobileoverlord.com/instruments-optimizing-core-animation/