summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2014-01-15 04:25:53 -0800
committerJay Freeman (saurik) <saurik@saurik.com>2014-01-15 04:27:04 -0800
commitc7ea4f3c017eed69ea90f3ade0253d8fade099d2 (patch)
tree9ac78948196d0a7797c66f75f19a468eaf5f56a6
parent4bee32e5fc2f9ea920e36549a6f1cfccbf849c1f (diff)
iOS 7 alertSheet->alertView (thanks rpetrich!).
-rw-r--r--Tweak.xm11
1 files changed, 10 insertions, 1 deletions
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);