Browse Source

make VLC compile with Xcode 9.3 beta 2

Carola Nitz 7 years ago
parent
commit
aa0e659d7f
2 changed files with 7 additions and 3 deletions
  1. 2 2
      Sources/KeychainCoordinator.swift
  2. 5 1
      Sources/VLCWatchCommunication.m

+ 2 - 2
Sources/KeychainCoordinator.swift

@@ -27,7 +27,7 @@ class KeychainCoordinator:NSObject, PAPasscodeViewControllerDelegate {
         var touchIDEnabled = UserDefaults.standard.bool(forKey:kVLCSettingPasscodeAllowTouchID)
         let laContext = LAContext()
 
-        if #available(iOS 11.0, *), laContext.canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, error: nil) {
+        if #available(iOS 11.0.1, *), laContext.canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, error: nil) {
             touchIDEnabled = touchIDEnabled && laContext.biometryType == .touchID
         }
         return touchIDEnabled
@@ -36,7 +36,7 @@ class KeychainCoordinator:NSObject, PAPasscodeViewControllerDelegate {
         var faceIDEnabled = UserDefaults.standard.bool(forKey:kVLCSettingPasscodeAllowFaceID)
         let laContext = LAContext()
 
-        if #available(iOS 11.0, *), laContext.canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, error: nil) {
+        if #available(iOS 11.0.1, *), laContext.canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, error: nil) {
             faceIDEnabled = faceIDEnabled && laContext.biometryType == .faceID
         }
         return faceIDEnabled

+ 5 - 1
Sources/VLCWatchCommunication.m

@@ -175,7 +175,11 @@ static VLCWatchCommunication *_singeltonInstance = nil;
 }
 
 - (void)requestThumnail:(VLCWatchMessage *)message {
-    NSString *uriString = message.payload[VLCWatchMessageKeyURIRepresentation];
+    NSAssert([message.payload isKindOfClass:[NSDictionary class]], @"the payload needs to be an NSDictionary");
+    if (![message.payload isKindOfClass:[NSDictionary class]]) return;
+
+    NSDictionary *payload = (NSDictionary *)message.payload;
+    NSString *uriString = payload[VLCWatchMessageKeyURIRepresentation];
     NSURL *url = [NSURL URLWithString:uriString];
     NSManagedObject *object = [[MLMediaLibrary sharedMediaLibrary] objectForURIRepresentation:url];
     if (object) {