I am trying to present a view controller in a tvOS
application, but neither of the included code snippets present one. What am I missing?
Code 1 :
DinoViewController *dinoVC = [[DinoViewController alloc]init];
dinoVC.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[self presentViewController:dinoVC animated:YES completion:nil];
Code 2 :
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
DinoViewController *dinoVC = [storyboard instantiateInitialViewController];
dinoVC.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[self presentViewController:dinoVC animated:YES completion:nil];
Found the correct answer: Mention Identifier
in the tvOS storyboard, (not the same in iOS,) and then implement this code:
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
UIViewController *dinoVC = [storyboard instantiateViewControllerWithIdentifier:@"Page1"];
[self presentViewController:dinoVC animated:YES completion:nil];