Browse Source

VLCOneDrive: fix tvOS build

UIAlertView is not available on tvOS so we need to use the UIAlertController instead
Carola Nitz 7 years ago
parent
commit
163896a4e8
1 changed files with 10 additions and 6 deletions
  1. 10 6
      Sources/VLCOneDriveObject.m

+ 10 - 6
Sources/VLCOneDriveObject.m

@@ -216,12 +216,16 @@
         }
         [receivedSub writeToFile:FileSubtitlePath atomically:YES];
     } else {
-        VLCAlertView *alert = [[VLCAlertView alloc] initWithTitle:NSLocalizedString(@"DISK_FULL", nil)
-                                                          message:[NSString stringWithFormat:NSLocalizedString(@"DISK_FULL_FORMAT", nil), [subtitleURL lastPathComponent], [[UIDevice currentDevice] model]]
-                                                         delegate:self
-                                                cancelButtonTitle:NSLocalizedString(@"BUTTON_OK", nil)
-                                                otherButtonTitles:nil];
-        [alert show];
+        UIAlertController *alertController = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"DISK_FULL", nil)
+                                                                                 message:[NSString stringWithFormat:NSLocalizedString(@"DISK_FULL_FORMAT", nil), [subtitleURL lastPathComponent], [[UIDevice currentDevice] model]]
+                                                                          preferredStyle:UIAlertControllerStyleAlert];
+
+        UIAlertAction *okAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"BUTTON_OK", nil)
+                                                           style:UIAlertActionStyleCancel
+                                                         handler:nil];
+
+        [alertController addAction:okAction];
+        [[UIApplication sharedApplication].keyWindow.rootViewController presentViewController:alertController animated:YES completion:nil];
     }
 
     return FileSubtitlePath;