3

There is a UIActivityIndicatorView in the secondView controller and it is not spinning when I am moving from firstView controller to secondView controller. The code behind moving from firstView controller to secondView controller is given below:

[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:2.0f];
[UIView setAnimationCurve: UIViewAnimationCurveEaseInOut];
secondView *secondObj = [self.storyboard instantiateViewControllerWithIdentifier:@"secondCtrolr"];
[self.navigationController secondObj animated:NO];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:self.navigationController.view cache:NO];
[UIView commitAnimations];

Then in secondView controller it only shows the spinner which is not spinning. The I remove the custom animation code like that following

secondView *secondObj = [self.storyboard instantiateViewControllerWithIdentifier:@"secondCtrolr"];
[self.navigationController secondObj animated:NO];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:self.navigationController.view cache:NO];

Then I show that spinner is spinning in secondView controller but there is no transition animation. And also if I write the animation transition code like:

[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:self.view cache:NO]; 

Then spinner is spinning but no transition animation happens.

The code which I write for spinner is give below:

UIActivityIndicatorView *rotator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
[rotator setBackgroundColor:[UIColor blackColor]];
[rotator setAlpha:0.7f];
rotator.hidesWhenStopped = YES;
rotator.frame = self.view.bounds;
[self.view addSubview:rotator]; // spinner is not visible until started
[rotator startAnimating];

What's the problem behind this?

vvvvv
  • 25,404
  • 19
  • 49
  • 81
Banshi
  • 1,335
  • 2
  • 13
  • 21

0 Answers0