Skip to content

Instantly share code, notes, and snippets.

@zummenix
Last active January 13, 2016 05:14
Show Gist options
  • Save zummenix/3da61e71df6e199099a2 to your computer and use it in GitHub Desktop.
Save zummenix/3da61e71df6e199099a2 to your computer and use it in GitHub Desktop.
This fixes crash related to UIStatusBar on iOS 7.
#import <objc/runtime.h>
+ (void)swizzletouchesEndedForUIStatusBar
{
if (IS_OS_7_OR_LATER && !IS_OS_8_OR_LATER) {
Method original, swizzled;
original = class_getInstanceMethod(NSClassFromString(@"UIStatusBar"), @selector(touchesEnded:withEvent:));
swizzled = class_getInstanceMethod(self, @selector(swizzled_touchesEnded:withEvent:));
method_exchangeImplementations(original, swizzled);
}
}
- (void)swizzled_touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
}
// Call `swizzletouchesEndedForUIStatusBar` somewhere.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment