在故事板之前的 iOS 中,我使用 nib 并使用以下代码呈现 UIViewControllers 视图。我试图弄清楚如何用故事板做到这一点。它在调用 initWithNib 时崩溃。我愿意接受有关如何解决此问题的所有建议。先感谢您。
folderCollectionView = [[FolderCollectionViewController alloc] initWithNibName:@"FolderCollectionViewController" bundle:nil];
folderView = [folderCollectionView view];
[folderView setFrame:CGRectMake([[self view] bounds].origin.x, [[self view] bounds].origin.y, [[self view] bounds].size.width, [[self view] bounds].size.height)];
folderCollectionView.delegate = self;
[[self view] insertSubview:folderView atIndex:1];
[[self view] bringSubviewToFront:folderView];
[folderView setBackgroundColor:[UIColor colorWithRed:0.0f green:0.0f blue:0.0f alpha:0.0f]];
folderView.alpha = 0.0;
[UIView animateWithDuration:1.2f
delay:0.0f
options: UIViewAnimationCurveEaseIn
animations:^{
folderView.alpha = 1.0;
}completion:nil];