I am creating an app and I have bumped into a problem.
My app has a play button, once the user presses it a animation plays and finishes.
I have created the above in code which I will display below, but I need some help.
When the player press's play, it should display a label saying shake to start, and when the user shake's the iPhone the label will disappear and the animation will start. I am not able to put the animation code inside the IBAction code. Please help :)
-(IBAction)startanimation {
animation.animationImages= [NSArray arrayWithObjects:
[UIImage imageNamed:@"Frame0.png"],
[UIImage imageNamed:@"Frame1.png"],
[UIImage imageNamed:@"Frame2.png"],
[UIImage imageNamed:@"Frame3.png"],
[UIImage imageNamed:@"Frame4.png"],
[UIImage imageNamed:@"Frame5.png"],
[UIImage imageNamed:@"Frame6.png"],
[UIImage imageNamed:@"Frame7.png"],
[UIImage imageNamed:@"Frame8.png"],
[UIImage imageNamed:@"Frame9.png"],
[UIImage imageNamed:@"Frame10.png"],
[UIImage imageNamed:@"Frame11.png"],
[UIImage imageNamed:@"Frame12.png"],
[UIImage imageNamed:@"Frame13.png"],
[UIImage imageNamed:@"Frame14.png"],
nil];
[animation setAnimationRepeatCount:1];
animation.animationDuration = 1;
[animation startAnimating];
button.hidden = 1;
animation.hidden = 0;
Menu.hidden = 0;
replay.hidden = 0;
}
I am a beginner at coding so please explain any answers :)
Thanks
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…