本文翻译自:Instantiate and Present a viewController in Swift
Issue 问题
I started taking a look of the new Swift
on Xcode 6
, and I tried some demo projects and tutorials. 我开始看看Xcode 6
上的新Swift
,我尝试了一些演示项目和教程。 Now I am stuck at: 现在我被困在:
Instantiating and then presenting a viewController
from a specific storyboard 实例化然后从特定的故事板呈现viewController
Objective-C Solution Objective-C解决方案
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"myStoryboardName" bundle:nil];
UIViewController *vc = [storyboard instantiateViewControllerWithIdentifier:@"myVCID"];
[self presentViewController:vc animated:YES completion:nil];
How to achieve this on Swift? 如何在Swift上实现这一目标?
#1楼
参考:https://stackoom.com/question/1CQRa/在Swift中实例化和呈现viewController
#2楼
It all is a matter