From: Jay Freeman (saurik) Date: Wed, 15 Jan 2014 12:25:53 +0000 (-0800) Subject: iOS 7 alertSheet->alertView (thanks rpetrich!). X-Git-Tag: v0.9.4000~7 X-Git-Url: https://git.saurik.com/safemode-ios.git/commitdiff_plain/c7ea4f3c017eed69ea90f3ade0253d8fade099d2?ds=sidebyside iOS 7 alertSheet->alertView (thanks rpetrich!). --- diff --git a/Tweak.xm b/Tweak.xm index e63d8e7..69a6d27 100644 --- a/Tweak.xm +++ b/Tweak.xm @@ -55,7 +55,7 @@ Class $SafeModeAlertItem; - (void) setNumberOfRows:(NSInteger)rows; @end -void SafeModeAlertItem$alertSheet$buttonClicked$(id self, SEL sel, id sheet, int button) { +void SafeModeButtonClicked(int button) { switch (button) { case 1: break; @@ -72,7 +72,15 @@ void SafeModeAlertItem$alertSheet$buttonClicked$(id self, SEL sel, id sheet, int [[UIApplication sharedApplication] applicationOpenURL:[NSURL URLWithString:@"http://cydia.saurik.com/safemode/"]]; break; } +} + +void SafeModeAlertItem$alertSheet$buttonClicked$(id self, SEL sel, id sheet, int button) { + SafeModeButtonClicked(button); + [self dismiss]; +} +void SafeModeAlertItem$alertView$clickedButtonAtIndex$(id self, SEL sel, id sheet, NSInteger button) { + SafeModeButtonClicked(button + 1); [self dismiss]; } @@ -103,6 +111,7 @@ static void MSAlert() { return; class_addMethod($SafeModeAlertItem, @selector(alertSheet:buttonClicked:), (IMP) &SafeModeAlertItem$alertSheet$buttonClicked$, "v@:@i"); + class_addMethod($SafeModeAlertItem, @selector(alertView:clickedButtonAtIndex:), (IMP) &SafeModeAlertItem$alertView$clickedButtonAtIndex$, "v@:@i"); class_addMethod($SafeModeAlertItem, @selector(configure:requirePasscodeForActions:), (IMP) &SafeModeAlertItem$configure$requirePasscodeForActions$, "v@:cc"); class_addMethod($SafeModeAlertItem, @selector(performUnlockAction), (IMP) SafeModeAlertItem$performUnlockAction, "v@:"); objc_registerClassPair($SafeModeAlertItem);