Skip to content

Instantly share code, notes, and snippets.

@orkoden orkoden/fishytitles.m
Last active Apr 23, 2019

Embed
What would you like to do?
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
You can’t perform that action at this time.