0

Ok, so I have this animation

[UIView animateWithDuration:1.5  delay:0.0 options:UIViewAnimationOptionCurveLinear animations:^(void){
    self.center = CGPointMake(velocity.x+self.frame.origin.x, velocity.y+self.frame.origin.y);
    }
                 completion:^(BOOL finished){
                     [self removeFromSuperview];
                     [self setDone:true];
                 }];

When I run this on devices that have a height of 480 it works perfectly but when I use the iPhone 5 the animation happens almost instantly and you can barely see the image being animated.

My guess is that the iPhone 5 doesn't have access to UIViewAnimationOptionCurveLinear. could this be true? Has anyone else had this problem?

klcjr89
  • 5,862
  • 10
  • 58
  • 91
Nick P
  • 147
  • 1
  • 1
  • 9
  • UIViewAnimationOptionCurveLinear isn't deprecated. the more likely cause is layout constraints in the newer project are changing the frame coordinates in some what that you don't expect. Consider logging some x,y values before and in completion block to see what's really moving where. – danh Apr 08 '13 at 00:56
  • ok so i logged the values on the iPhone 5 and they are just as expected. Whats happening is the object animates to the point very fast then once the 1.5 seconds is up it calls complete. the issue is why doesn't it take the 1.5 seconds to get there? – Nick P Apr 08 '13 at 01:04
  • Something else is going on in that project. Maybe another animation involving the same view, maybe this animation getting triggered twice. In other words, if I built a project that had just this animation in it, it would work fine, right? What else interacts with the view? Maybe post more contextual code here. – danh Apr 08 '13 at 06:10
  • this is the only animation in the entire project, what gets me is that it works perfectly on the other devices, and logs the same on both devices it just appears differently. – Nick P Apr 08 '13 at 17:38
  • I built a single-view project that has a UIView subclass that does this animation. I place the subview on in storyboard and it animates just fine using your code on every sort of simulator. – danh Apr 08 '13 at 22:34
  • Have yout tried it on an actual iphone 5? – Nick P Apr 09 '13 at 02:18
  • I've been looking for an excuse to buy one... :-) – danh Apr 09 '13 at 05:01

0 Answers0