Skip to content

Instantly share code, notes, and snippets.

@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];
}