我想在视图控制器之间使用幻灯片视图。我找到了这些来源
但在这段代码中,它与情节提要一起使用。我不想使用故事板,我想在 nib 文件上使用。我怎样才能做到这一点 ?
- (void)applicationDidFinishLaunching:(UIApplication *)application {
UIViewController *topController = [[TopController alloc] initWithNibName:<#(NSString *)#> bundle:<#(NSBundle *)#>];
UINavigationController *topViewController = [[UINavigationController alloc] initWithRootViewController:topController];
ECSlidingViewController *slidingController = [[ECSlidingViewController alloc] initWithTopViewController:topViewController];
slidingController.underLeftViewController = [[SideMenuController alloc] initWithNibName:<#(NSString *)#> bundle:<#(NSBundle *)#>];
[window setRootViewController:slidingController];
[window makeKeyAndVisible];
}
如果您需要参考设置顶视图控制器和侧边菜单控制器,您可以参考示例项目——TransitionFun。顶视图和视图控制器可以是任何 UIViewController。
http://code4app.com/ios/Side-bar-demo/50c83b396803fa2d4d000001 try this. But it's Chinese, you can translate it, code can be downloaded via the big button right side.
It uses the xib, very simple and useful. Hopefully it helps you.