我需要UIViewController
在Spash Screen
执行后选择。例如:Splash Screen
执行后
if (condition) {
call UIViewController2
}else{
call UIViewController2
}
我在这里找到了正确的信息使用 Storyboards 以编程方式设置初始视图控制器并工作。谢谢大家
我需要UIViewController
在Spash Screen
执行后选择。例如:Splash Screen
执行后
if (condition) {
call UIViewController2
}else{
call UIViewController2
}
我在这里找到了正确的信息使用 Storyboards 以编程方式设置初始视图控制器并工作。谢谢大家
这可能会帮助您:
在 viewController.h 中导入 ViewController 目标并在情节提要中提供一个标识符:
if(condition) {
viewController1 *v1 = (viewController1 *)[self.storyboard instantiateViewControllerWithIdentifier:@"view1"];
[self presentViewController:v1 animated:YES completion:nil];
}
else {
// same code but with other viewController
}
希望这可以帮助
BOOL condition;
if(condition) {
UIViewController2 *v2 = [[UIViewController2 alloc] init];
[self presentingViewController:v2 completion:nil]; // iOS 6.0 +
[self presentModalViewController:v2 animated:YES]; // iOS 2.0, but depreciated in iOS 6
}
else {
// not fully sure what you're asking for this part, but do the same as above
// if you're looking for the same view controller
}