Let's assume we have 2 view controllers named ViewControllerA and ViewControllerB.
I have following intialization mechanism when I did not use the storyboard.
//ViewControllerA.h
@interface ViewControllerA : UIViewController
@end
//ViewControllerA.m
@implementation ViewControllerA
- (IBAction)showViewControllerB:(id)sender {
ViewControllerB *vcB = [[ViewControllerB alloc] initWithTitle:@"Test"];
[self.navigationController pushViewController:vcB animated:YES];
}
@end
//ViewControllerB.h
@interface ViewControllerB : UIViewController
- (id)initWithTitle:(NSString *)title;
@end
//ViewControllerB.m
@interface ViewControllerB()
@property (nonatomic, retain) NSString *title;//Private scope.
@end
@implementation ViewControllerB
- (id)initWithTitle:(NSString *)title {
self = [self init];
if(self)
{
_title = title;
}
return self;
}
@end
How can I achieve this using storyboards without declaring the title property in public scope (ViewControllerB.h)?
Thanks in advance.