Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Ok, it seems like the new keyframe animation method in iOS7 doesn't want to play nicely with changes in uiimage on an image view, so we will have to use a CAKeyframe animation instead: This answer comes in part from here: http://stackoverflow.com/questions/16025769/how-do-i-simultaneously-animate-a-uiimageviews-image-and-the-uiimageview-itself</p> <pre><code>-(IBAction)animateImagesThenPushView:(id)sender{ NSArray *images = @[[UIImage imageNamed:@"navExitFrame1.png"], [UIImage imageNamed:@"navExitFrame2.png"], [UIImage imageNamed:@"navExitFrame3.png"], [UIImage imageNamed:@"navExitFrame4.png"], [UIImage imageNamed:@"navExitFrame5.png"], [UIImage imageNamed:@"navExitFrame6.png"]]; NSMutableArray *keyTimes = [NSMutableArray arrayWithCapacity:images.count]; for (int i = 0; i&lt;images.count; i++) { keyTimes[i] = @(0.0 + (i+1)*(1.0/images.count)); } CAKeyframeAnimation *imageAnimation = [CAKeyframeAnimation animationWithKeyPath:@"contents"]; imageAnimation.calculationMode = kCAAnimationDiscrete; // or maybe kCAAnimationPaced imageAnimation.duration = .5; imageAnimation.keyTimes = keyTimes; imageAnimation.repeatCount = 0; // the following method will need to be implemented to cast your UIImage array to CGImages imageAnimation.values = [self animationCGImagesArrayFromImageArray:images]; imageAnimation.delegate = self; [self.imageView.layer addAnimation:imageAnimation forKey:@"content"]; } - (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag{ self.imageView.image = [UIImage imageNamed:@"navExitFrame6.png"]; // put your segue logic here to push the next view } -(NSArray*)animationCGImagesArrayFromImageArray:(NSArray*)imageArray { NSMutableArray *array = [NSMutableArray arrayWithCapacity:imageArray.count]; for (UIImage *image in imageArray) { [array addObject:(id)[image CGImage]]; } return [NSArray arrayWithArray:array]; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload