@@ -43,17 +43,17 @@ - (void)showDialogWithMessage:(NSString*)message title:(NSString*)title buttons:
43
43
#ifdef __IPHONE_8_0
44
44
if (NSClassFromString (@" UIAlertController" )) {
45
45
UIAlertController *alertController = [UIAlertController alertControllerWithTitle: title message: message preferredStyle: UIAlertControllerStyleAlert];
46
-
46
+
47
47
if ([[[UIDevice currentDevice ] systemVersion ] floatValue ] < 8.3 ) {
48
48
CGRect alertFrame = [UIScreen mainScreen ].applicationFrame ;
49
-
49
+
50
50
if (UIInterfaceOrientationIsLandscape ([[UIApplication sharedApplication ] statusBarOrientation ])) {
51
51
// swap the values for the app frame since it is now in landscape
52
52
CGFloat temp = alertFrame.size .width ;
53
53
alertFrame.size .width = alertFrame.size .height ;
54
54
alertFrame.size .height = temp;
55
55
}
56
-
56
+
57
57
alertController.view .frame = alertFrame;
58
58
}
59
59
@@ -83,18 +83,18 @@ - (void)showDialogWithMessage:(NSString*)message title:(NSString*)title buttons:
83
83
[weakNotif.commandDelegate sendPluginResult: result callbackId: callbackId];
84
84
}]];
85
85
}
86
-
86
+
87
87
if ([dialogType isEqualToString: DIALOG_TYPE_PROMPT]) {
88
-
88
+
89
89
[alertController addTextFieldWithConfigurationHandler: ^(UITextField *textField) {
90
90
textField.text = defaultText;
91
91
}];
92
92
}
93
-
93
+
94
94
if (!alertList)
95
95
alertList = [[NSMutableArray alloc ] init ];
96
96
[alertList addObject: alertController];
97
-
97
+
98
98
if ([alertList count ]==1 ) {
99
99
[self presentAlertcontroller ];
100
100
}
@@ -109,19 +109,19 @@ - (void)showDialogWithMessage:(NSString*)message title:(NSString*)title buttons:
109
109
delegate: self
110
110
cancelButtonTitle: nil
111
111
otherButtonTitles: nil ];
112
-
112
+
113
113
alertView.callbackId = callbackId;
114
-
114
+
115
115
for (int n = 0 ; n < count; n++) {
116
116
[alertView addButtonWithTitle: [buttons objectAtIndex: n]];
117
117
}
118
-
118
+
119
119
if ([dialogType isEqualToString: DIALOG_TYPE_PROMPT]) {
120
120
alertView.alertViewStyle = UIAlertViewStylePlainTextInput;
121
121
UITextField* textField = [alertView textFieldAtIndex: 0 ];
122
122
textField.text = defaultText;
123
123
}
124
-
124
+
125
125
[alertView show ];
126
126
#ifdef __IPHONE_8_0
127
127
}
0 commit comments