Alok C
Alok C

Reputation: 2857

UIAlert View and Animation

As we know Alert view is shown as modally. I am not sure if this is possible. I want to animation to start only when user press OK on Alert View

AlertView code:

    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Search" message:@"Not Available" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];

Animation code :

    NSInteger tabBarIndex = 3;
UITabBarController *myTabBar = self.tabBarController;
UIView *searchView = myTabBar.selectedViewController.view;
UIView *aboutView = [[[myTabBar viewControllers] objectAtIndex:tabBarIndex] view];
//animation
[UIView transitionFromView:searchView
                    toView:aboutView duration:1
                   options:UIViewAnimationOptionTransitionFlipFromRight                    completion:^(BOOL finished) {
                       if(finished)
                       {
                           myTabBar.selectedIndex = tabBarIndex;

                       }
                   }
 ];

is there anyway to do this ?

Upvotes: 0

Views: 26

Answers (1)

Robert J. Clegg
Robert J. Clegg

Reputation: 7360

Yes its possible.

Using UIAlertView's delegate method: alertView:clickedButtonAtIndex: you can check which button was pressed and start the animation when that happens.

Upvotes: 1

Related Questions