Skip to content

Instantly share code, notes, and snippets.

@ahmedk92 ahmedk92/commonInit.m forked from aaronshekey/commonInit.m
Last active May 22, 2019

Embed
What would you like to do?
Common initialization methods for a custom view in Objective C
- (void)commonInit {
// Do stuff.
}
- (instancetype)init {
if (self = [super init]) {
[self commonInit];
}
return self;
}
- (instancetype)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
[self commonInit];
}
return self;
}
- (instancetype)initWithCoder:(NSCoder *)aDecoder {
if (self = [super initWithCoder:aDecoder]) {
[self commonInit];
}
return self;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.