Question: I am creating a user registration functionality in my application and needed some direction in how to implement it. Currently, my main screen only has a sign up button. When the user clicks the sign up button, a modalview slides up from the bottom and presents the user with the required textfields for registration. The user fills out the form and clicks the submit button on the top right of the nav bar ( I added a nav bar to the modalview). When the user clicks the submit button, I would like for the modalview to "disappear" and display a activity indicator while validation takes place. If a user successfully registers, the activity indicator should disappear and the new screen slide in from the right. If the submission failed for any reason, the modal view should "re-appear" with the information the user entered. 

Right now my problem is hiding the modalview during validation and sliding in the new screen on successful registration. What are some approaches to this?

Thanks much in advance!

Here is the method that creates the modalview:

```
- (void)getSignUpView:(id)sender
{

    SignUpViewController *signUpViewcontroller = [[SignUpViewController alloc]
                                                  initWithStyle:UITableViewStyleGrouped];

    UINavigationController *navigationController = [[UINavigationController     alloc] initWithRootViewController:signUpViewcontroller];
    [self presentModalViewController:navigationController animated:YES];

    [signUpViewcontroller release];

}

```

Answer: 
I would suggest you add the activity indicator as another view to your navigation controller and set the animation to NO. If the validation is successful pop out this view and add the new controller with animation set to YES.

If unsucessfull then pop till the root view controller. Your piece of code suggests you are aware of the method calls to do so. Let me know if you need some additional code.
Take Navigation controller to appear in modal view, and inside navigation controller, there would be view controller, so that you do not need to take navigation bar in modal view.

```
[self presentModalViewController:navController animated:YES];

```

where navController is UINavigationController, this way it would be easy if user clicks on top right corner button, wait for loading indicator or registration, Do not dismiss modal view, and if registration success, you can push new view controller into navigation controller.