0

Can't seem to figure this out. I'm attempting to load a UIView (preferably sliding in from the right) on button tap but it isn't changing after the first page.

  1. I click the register button on the settings page and it loads the first register page, then on the first register page, when I click the continueButton to load the second page it wont do anything at all..

SettingsPage.m:

- (void)regsiterButton:(UIButton *)standardButton { MAINVIEWCONTROLLER.mainView = [[RegisterStep1 alloc] initWithFrame:MAINVIEWCONTROLLER.mainView.frame]; } 

RegisterStep1.m - Attempting to load the next register page, but it isn't working:

- (void)continueButton:(UIButton *)standardButton { MAINVIEWCONTROLLER.mainView = [[RegisterStep2 alloc] initWithFrame:MAINVIEWCONTROLLER.mainView.frame]; } 

1 Answer 1

1

Assuming RegisterStep1 is a UIViewController subclass, you want to use UINavigationController's pushViewController:animated: method, which does the default transition from the right.

If you don't have a UINavigationController already set up, you'll want to wrap SettingsPage in one via initWithRootViewController: before using it.

This Apple guide describes how navigation controllers fit into the overall navigation of an app.

Sign up to request clarification or add additional context in comments.

Comments