Skip to content

Instantly share code, notes, and snippets.

@consoledotblog
Last active August 29, 2015 13:57
Show Gist options
  • Save consoledotblog/9487706 to your computer and use it in GitHub Desktop.
Save consoledotblog/9487706 to your computer and use it in GitHub Desktop.
How to Share View Controllers for iPhone and iPad Using Nibs for Reuse and Portability
#import "SLMainViewController.h"
// Override point for customization after application launch.
SLMainViewController *mainViewController = [[SLMainViewControlleralloc] init];
self.window.rootViewController = mainViewController;
-(NSString *)nibName {
return @"SLMainViewController"
}
@interface SLMainViewController ()
@property (weak, nonatomic) IBOutlet UILabel *greetingLabel;
@end
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
self.greetingLabel.text = [NSString stringWithFormat:"%@ %@", self.greetingLabel.text, "Vinny"];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment