Good night everyone, I needed a switch to another ViewController through the code, usually I connected the button to the UIViewController directly via Ctrl, (modal). Now the program first opens a check on the connection to the Internet and if everything is ok, the main UIViewController opens with the program. But it was not there, for the second day I’m looking for how to correctly put the transition from one to another View. The only thing that tried to go anywhere is this code:
import "ViewController" ... ViewController *test = [[ViewController alloc] init]; [self presentViewController:test animated:YES completion:nil];
But he opened a black background, not a view. I also tried
ViewController *test = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil]; [self.navigationController pushViewController:test animated:YES];
Nothing happens at all, I tried many more different ways, but these were in almost all articles. Help please, what is the error. I need any transition at all, without any problems. Thank you very much in advance.