Skip to content

Instantly share code, notes, and snippets.

@Anviking
Created October 20, 2013 16:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Anviking/7072001 to your computer and use it in GitHub Desktop.
Save Anviking/7072001 to your computer and use it in GitHub Desktop.
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];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment