• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Original iPhone animation performance
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Original iPhone animation performance


  • Subject: Original iPhone animation performance
  • From: Andrew <email@hidden>
  • Date: Wed, 19 May 2010 20:01:27 +1200

Hi All,

Im writing some code to animate an image moving up the display, just a simple thing moving from the bottom to the top.

the image is 75x75, and Im displaying that in a CALayer sized to 45x45 by setting its .contents property to the .CGImage of the UIImage.


on the newer phones this runs very smoothly, even if I have more than one of those CALayers animating at once, but on an older (original) iPhone I am testing on the animation is slightly rough/jerky even with only a single image moving.


The iPhone is running 3.1.3 and I am performing the animation using this code:

CABasicAnimation* animation = [CABasicAnimation animation];
animation.keyPath = @"position.y";

CGFloat from=self.position.y;
CGFloat to=self.position.y-[self.calculator distanceForAnimationStartingAt:from];

animation.fromValue = [NSNumber numberWithFloat:from];
animation.toValue = [NSNumber numberWithFloat:to];

CGFloat distance=to-from;

animation.duration = [self.calculator timeToTravelDistance:distance];
animation.repeatCount = 1;
animation.autoreverses = NO;
animation.timingFunction = [CAMediaTimingFunction functionWithName: kCAMediaTimingFunctionEaseInEaseOut];
animation.removedOnCompletion = NO;
animation.fillMode = kCAFillModeForwards;
animation.delegate=self;
[self addAnimation:animation forKey:@"animateUp"];


so, obviously the older phone is basically just less capable, but is it likely to be possible to smooth things out?  are there any known tricks or things I can do that might improve things on the older hardware?


Thanks for any help.


- Andrew Bush







_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Original iPhone animation performance
      • From: Ricky Sharp <email@hidden>
  • Prev by Date: Re: Custom View Binding, Arrays, and observeValueForKeyPath
  • Next by Date: Re: Regarding MVC design pattern
  • Previous by thread: Re: Custom View Binding, Arrays, and observeValueForKeyPath (solved)
  • Next by thread: Re: Original iPhone animation performance
  • Index(es):
    • Date
    • Thread