我想在我的项目中使用这个ECSlidingViewController。链接中的示例应用程序使用情节提要,但我想从 xibs 加载所有内容。我必须在 application:didFinishLaunchingWithOptions: 中实现什么来做到这一点?
来自示例应用程序的代码:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
ECSlidingViewController *slidingViewController = (ECSlidingViewController *)self.window.rootViewController;
UIStoryboard *storyboard;
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
storyboard = [UIStoryboard storyboardWithName:@"iPhone" bundle:nil];
} else if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
storyboard = [UIStoryboard storyboardWithName:@"iPad" bundle:nil];
}
slidingViewController.topViewController = [storyboard instantiateViewControllerWithIdentifier:@"FirstTop"];
return YES;
}