S.J
S.J

Reputation: 3071

how to add a view in uinavcontroller which is displaying as a modal

My view contains a signup button which display signup view modally, I want this signup inside uinavigationcontroller, how can I add this view inside uinavcontroller.

Upvotes: 0

Views: 90

Answers (1)

Husker Jeff
Husker Jeff

Reputation: 857

Just have your button's action method present the navigation controller like this:

-(IBAction)showSignup:(id)sender {
    MyViewController *signupController = [[MyViewController alloc] init];
    //Other setup for signupController;

    UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:signupController];

    //Set modal presentation and transition styles, if needed.

    [self presentModalViewController:navController animated:YES];
}

Upvotes: 2

Related Questions