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.
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];
}
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.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.