多个入口指向故事板
我需要在启动时在AppDelegate中做出一系列决定,具体取决于我需要转到故事板特定部分的结果。
所以我的问题是 – 没有使用任何导航或选项卡控制器,如何去故事板的特定部分?
要么
是唯一受支持的选项有多个故事板 – 对于每个“结果”,然后根据需要加载这些选项?
谢谢
为每个ViewController分配一个ID,然后用以下方法实例化所需的ID:
UIViewController *initialVC = [storyboard instantiateViewControllerWithIdentifier:@"<identifier>"];
为每个ViewController在故事板中提供一个唯一的标识符。 然后在appDelegate中:
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil]; UIViewController *vc = [storyboard instantiateViewControllerWithIdentifier:@"PUT_UNIQUE_ID_HERE"]; //DO WHAT YOU WANT WITH YOUR VIEWCONTROLLER //Example:Set it as the root view of the app window...