Skip to content

Instantly share code, notes, and snippets.

@orkoden
Last active April 23, 2019 22:28
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 orkoden/6b595d136dbc7df76d97aa0ad05c41b3 to your computer and use it in GitHub Desktop.
Save orkoden/6b595d136dbc7df76d97aa0ad05c41b3 to your computer and use it in GitHub Desktop.
Swizzle all UIViewController titles to fish emoji ๐Ÿ 
IMP titleImp = imp_implementationWithBlock(^NSString *(__unsafe_unretained id foo){
return @"๐Ÿ ";
});
SEL titleSelector = NSSelectorFromString(@"title");
Method existingTitle = class_getInstanceMethod([UIViewController class],
titleSelector);
method_setImplementation(existingTitle,
titleImp);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment