Question

Really weird issue, i've got a view (view 2) that i'm popping to bring up my main view (view 1) which has an animated background. Once i pop from view 2, view 1 loses those animations... the weird thing is that moving the iOS status bar in the slightest will restart them!

Any ideas?

This is the code that i'm using to pop the view. If I pop the view without animations, it works fine.

-(IBAction)popOnSwipe {
[UIView beginAnimations:@"" context:nil];
[UIView setAnimationDuration:0.75];
[UIView setAnimationCurve:UIViewAnimationTransitionCurlDown];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:self.navigationController.view cache:NO];
[navController popViewControllerAnimated:NO];
[UIView commitAnimations];

One more thing; the animation starts back up on the simulator, but not on the iTouch i'm testing it on. Any insight would be greatly appreciated,

thanks!

Was it helpful?

Solution 2

The device I was using was faulty, the method works fine on my other devices. Thanks for the help.

OTHER TIPS

Add your animations for view1 in DidStopSelector method like,

-(IBAction)popOnSwipe 
{
[UIView beginAnimations:@"" context:nil];
[UIView setAnimationDuration:0.75];
[UIView setAnimationCurve:UIViewAnimationTransitionCurlDown];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:self.navigationController.view cache:NO];
[UIView setAnimationDidStopSelector:@selector(view1_animation)];//add this line
[navController popViewControllerAnimated:NO];
[UIView commitAnimations];
}
-(void)view1_animation
{
  //do animations for view1
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top