Last active
December 29, 2015 11:59
-
-
Save floriankrueger/7667447 to your computer and use it in GitHub Desktop.
Cocoa (Touch) templates for common subclasses
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "XQCView.h" | |
@interface XQCView () | |
@end | |
@implementation XQCView | |
#pragma mark - Memory Management | |
- (void)dealloc | |
{ | |
} | |
#pragma mark - Setup & Init | |
- (id)initWithFrame:(CGRect)frame | |
{ | |
self = [super initWithFrame:frame]; | |
if (self) { | |
[self setup]; | |
} | |
return self; | |
} | |
- (void)setup | |
{ | |
[self setupSubviews]; | |
[self setupLayout]; | |
} | |
#pragma mark - Setup & Init (Private) | |
- (void)setupSubviews | |
{ | |
} | |
- (void)setupLayout | |
{ | |
} | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "XQCViewController.h" | |
#import "XQCView.h" | |
@interface XQCViewController () | |
@end | |
@implementation XQCViewController | |
#pragma mark - Memory Management | |
- (void)dealloc | |
{ | |
} | |
- (void)didReceiveMemoryWarning | |
{ | |
[super didReceiveMemoryWarning]; | |
// Dispose of any resources that can be recreated. | |
} | |
#pragma mark - Setup & Init | |
- (id)initWithCoder:(NSCoder *)aDecoder | |
{ | |
self = [super initWithCoder:aDecoder]; | |
if (self) { | |
[self setup]; | |
} | |
return self; | |
} | |
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil | |
{ | |
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; | |
if (self) { | |
[self setup]; | |
} | |
return self; | |
} | |
- (void)setup | |
{ | |
self.title = @"Example View Controller"; | |
} | |
#pragma mark - View Lifecycle | |
- (void)loadView | |
{ | |
XQCView *view = [[XQCView alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; | |
view.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth; | |
self.view = view; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment