Note that there are some explanatory texts on larger screens.

plurals
  1. POUIImageView Delay or revert to different frame
    text
    copied!<p>Ok so I have been searching and have been unable to find an answers to this problem. (And I assume I can't find it because it is a very easy answer that everyone seems to know but me.) I am creating an app for IOS, where there is some opening animation and then I need the opening animation to stop and then different animation to take place instead. So I have the opening animation working fine and I have it stopping on the last frame. How do I get the new animation to start at the end of the opening animation? I am using UIImageView under the viewDidLoad() function. Here is my code for the ViewController.m file:</p> <pre><code>@implementation ViewController @synthesize hook_drop_one; @synthesize hook_swing_one; - (void)viewDidLoad { [super viewDidLoad]; hook_drop_aone=[[NSMutableArray alloc] init]; for (int i=1; i&lt;16; i++) { NSString *hookpic=[NSString stringWithFormat: @"hook%d.png",i]; UIImage *img = [UIImage imageNamed:hookpic]; if (img) [hook_drop_aone addObject:img]; [hook_drop_one setAnimationImages:(hook_drop_aone)]; [hook_drop_one setAnimationDuration:0.9f]; [hook_drop_one setAnimationRepeatCount:1]; [hook_drop_one startAnimating]; } hook_swing_aone=[[NSMutableArray alloc] init]; for (int i=1; i&lt;230; i++) { NSString *hookswingpic=[NSString stringWithFormat: @"hookswing%d.png",i]; UIImage *img = [UIImage imageNamed:hookswingpic]; if (img) [hook_swing_aone addObject:img]; [hook_swing_one setAnimationImages:(hook_swing_aone)]; [hook_swing_one setAnimationDuration:10.2f]; [hook_swing_one startAnimating]; } } </code></pre> <p>My code fro the ViewController.h file:</p> <pre><code>#import &lt;UIKit/UIKit.h&gt; @interface ViewController : UIViewController{ IBOutlet UIImageView *hook_drop_one; NSMutableArray *hook_drop_aone; IBOutlet UIImageView *hook_swing_one; NSMutableArray *hook_swing_aone; } @property (nonatomic,retain)UIImageView *hook_drop_one; @property (nonatomic,retain)NSMutableArray *hook_drop_aone; @property (nonatomic,retain)UIImageView *hook_swing_one; @property (nonatomic,retain)NSMutableArray *hook_swing_aone; @end </code></pre> <p>Now I understand why both animations are running at the same time when the app loads. I need to figure out how to trigger one animation after the first one stops, or set a delay for the second animation. </p> <p>Anyone got any ideas?</p>
 

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