I use code bellow, but it is not loaded:
UIStoryboard * storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
self.mapViewController = [storyboard instantiateViewControllerWithIdentifier:@"MapViewController"];
self.navigationController = [[UINavigationController alloc]initWithRootViewController:self];
self.navigationBar = [[UINavigationBar alloc]init];
[self.view addSubview:self.navigationBar];
[self.navigationController.navigationController pushViewController:self.mapViewController animated:YES];
Add this code to your
AppDelegate.m
in thedidFinishLaunchingWithOptions
function:yourViewControllerClassName
is the .h and .m file name that is linked to your viewController.YOUR_STORYBOARD_NAME
is the name of your .storyboard file. For example, fill inMain
if your .storyboard file is calledMain.storyboard
.YOUR_VIEWCONTROLLER_ID
is the ID for your veiwController. You can edit it in theIdentity inspector
.(See photo)Hope this helps:)
try as below