Example without storyboard:
AppDelegate.h
@property (retain, nonatomic) UIViewController *leftController;
AppDelegate.m
self.leftController = [[LeftViewController alloc] initWithNibName:@"LeftViewController" bundle:nil];
OtherViewController:
//This is what I want do to in storyboards
self.viewDeckController.leftController = (AppDelegate*)[[UIApplication sharedApplication] delegate].leftController;
How can I get that instance of leftController when using storyboards?
You can give the view controller an identifier in interface builder, then simply use:
UIStoryboard *mystoryboard = [UIStoryboard storyboardWithName:@"myStoryBoardName" bundle:nil];
self.leftController = [mystoryboard instantiateViewControllerWithIdentifier:@"idyouassigned"];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With