Skip to content

Instantly share code, notes, and snippets.

@happyrobots
Created June 23, 2014 03:51
Show Gist options
  • Save happyrobots/32a0dc8ce028416688ef to your computer and use it in GitHub Desktop.
Save happyrobots/32a0dc8ce028416688ef to your computer and use it in GitHub Desktop.
@import ObjectiveC;
@interface NSObject (LN_FORCE_SHAPES)
@end
@implementation NSObject (LN_FORCE_SHAPES)
+ (void)load
{
Method m1, m2;
m1 = class_getInstanceMethod(NSClassFromString(@"UINavigationButton"), @selector(_wantsAccessibilityButtonShapes));
m2 = class_getInstanceMethod([NSObject class], @selector(_wantsAccessibilityButtonShapes));
method_exchangeImplementations(m1, m2);
m1 = class_getInstanceMethod(NSClassFromString(@"UINavigationItemButtonView"), @selector(_wantsAccessibilityButtonShapes));
m2 = class_getInstanceMethod([NSObject class], @selector(_wantsAccessibilityButtonShapes));
method_exchangeImplementations(m1, m2);
m1 = class_getInstanceMethod(NSClassFromString(@"UIToolbarButton"), @selector(_wantsAccessibilityButtonShapes));
m2 = class_getInstanceMethod([NSObject class], @selector(_wantsAccessibilityButtonShapes));
method_exchangeImplementations(m1, m2);
}
- (BOOL)_wantsAccessibilityButtonShapes
{
return YES;
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment