我需要在UIViewController
执行后选择Spash Screen
。例如:
Splash Screen
执行后
if (condition) {
call UIViewController2
}else{
call UIViewController2
}
我在Programmatically set the initial view controller using Storyboards找到了正确的信息并且有效。谢谢大家
答案 0 :(得分:0)
希望这有帮助
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
}
答案 1 :(得分:0)
这可能会对您有所帮助:
在viewController.h中导入ViewController目标,并在storyboard中输入一个标识符:
if(condition) {
viewController1 *v1 = (viewController1 *)[self.storyboard instantiateViewControllerWithIdentifier:@"view1"];
[self presentViewController:v1 animated:YES completion:nil];
}
else {
// same code but with other viewController
}