-1

我需要UIViewControllerSpash Screen执行后选择。例如:Splash Screen执行后

if (condition) {
   call UIViewController2
}else{
   call UIViewController2
}

我在这里找到了正确的信息使用 Storyboards 以编程方式设置初始视图控制器并工作。谢谢大家

4

2 回答 2

0

这可能会帮助您:

在 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
 }
于 2013-08-08T10:21:00.817 回答
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
}
于 2013-08-07T18:46:50.637 回答