我在做一个应用程序,将有一个VC做类似的工作作为一个的UITabBarController和我使用包含UIViewControllers - 我应该使用.xib还是故事板?
[self addChildViewController:theViewController];
// [self addSubview ... etc
把一个自定义的UIViewController的观点作为我的主(根),VC的一个子视图。
所以我的问题是,这是实例化一个VC的正确方法,而不必编程构建它的UI - 从.xib文件或故事板?
随着厦门国际银行:
UICustomViewController *controller = [[UICustomViewController alloc] initWithNibName:@"customVC" bundle:nil];
有了记事板:
UICustomViewController* child = [self.storyboard instantiateViewControllerWithIdentifier:identifier];
相信的.xib文件是旧的东西和故事是要走的路,但我也看过this article,这表明使用故事板来做到这一点有点冒失。我不知道,有什么想法?