@@ -39,15 +39,12 @@ @implementation CDVNotification
39
39
*/
40
40
- (void )showDialogWithMessage : (NSString *)message title : (NSString *)title buttons : (NSArray *)buttons defaultText : (NSString *)defaultText callbackId : (NSString *)callbackId dialogType : (NSString *)dialogType
41
41
{
42
-
43
42
int count = (int )[buttons count ];
44
43
#ifdef __IPHONE_8_0
45
44
if (NSClassFromString (@" UIAlertController" )) {
46
-
47
45
UIAlertController *alertController = [UIAlertController alertControllerWithTitle: title message: message preferredStyle: UIAlertControllerStyleAlert];
48
46
49
47
if ([[[UIDevice currentDevice ] systemVersion ] floatValue ] < 8.3 ) {
50
-
51
48
CGRect alertFrame = [UIScreen mainScreen ].applicationFrame ;
52
49
53
50
if (UIInterfaceOrientationIsLandscape ([[UIApplication sharedApplication ] statusBarOrientation ])) {
@@ -101,7 +98,6 @@ - (void)showDialogWithMessage:(NSString*)message title:(NSString*)title buttons:
101
98
if ([alertList count ]==1 ) {
102
99
[self presentAlertcontroller ];
103
100
}
104
-
105
101
}
106
102
else
107
103
{
@@ -116,8 +112,6 @@ - (void)showDialogWithMessage:(NSString*)message title:(NSString*)title buttons:
116
112
117
113
alertView.callbackId = callbackId;
118
114
119
-
120
-
121
115
for (int n = 0 ; n < count; n++) {
122
116
[alertView addButtonWithTitle: [buttons objectAtIndex: n]];
123
117
}
@@ -132,7 +126,6 @@ - (void)showDialogWithMessage:(NSString*)message title:(NSString*)title buttons:
132
126
#ifdef __IPHONE_8_0
133
127
}
134
128
#endif
135
-
136
129
}
137
130
138
131
- (void )alert:(CDVInvokedUrlCommand*)command
@@ -239,15 +232,13 @@ -(UIViewController *)getTopPresentedViewController {
239
232
}
240
233
241
234
-(void )presentAlertcontroller {
242
-
243
235
__weak CDVNotification* weakNotif = self;
244
236
[self .getTopPresentedViewController presentViewController: [alertList firstObject ] animated: YES completion: ^{
245
237
[alertList removeObject: [alertList firstObject ]];
246
238
if ([alertList count ]>0 ) {
247
239
[weakNotif presentAlertcontroller ];
248
240
}
249
241
}];
250
-
251
242
}
252
243
253
244
@end
0 commit comments