Skip to content

Instantly share code, notes, and snippets.

View Anviking's full-sized avatar

Johannes Lund Anviking

View GitHub Profile
@Anviking
Anviking / gist:7072001
Created October 20, 2013 16:41
Alternative to method swizzling
@implementation NSLayoutManager (JLLayoutManager)
+ (id)alloc
// Let us replace the NSLayoutManager with JLLayoutManager
{
if ([self class] == [NSLayoutManager class]) {
return [JLLayoutManager alloc];
}
return [super alloc];
}