Sfoglia il codice sorgente

【VisionPro适配】适配VisionOS

xcbosa mbp16 1 anno fa
parent
commit
fa361f6666

+ 2 - 2
AFNetworking/AFSecurityPolicy.m

@@ -23,7 +23,7 @@
 
 #import <AssertMacros.h>
 
-#if !TARGET_OS_IOS && !TARGET_OS_WATCH && !TARGET_OS_TV
+#if !TARGET_OS_IOS && !TARGET_OS_WATCH && !TARGET_OS_TV && !TARGET_OS_VISION
 static NSData * AFSecKeyGetData(SecKeyRef key) {
     CFDataRef data = NULL;
 
@@ -41,7 +41,7 @@ _out:
 #endif
 
 static BOOL AFSecKeyIsEqualToKey(SecKeyRef key1, SecKeyRef key2) {
-#if TARGET_OS_IOS || TARGET_OS_WATCH || TARGET_OS_TV
+#if TARGET_OS_IOS || TARGET_OS_WATCH || TARGET_OS_TV || TARGET_OS_VISION
     return [(__bridge id)key1 isEqual:(__bridge id)key2];
 #else
     return [AFSecKeyGetData(key1) isEqual:AFSecKeyGetData(key2)];

+ 6 - 3
AFNetworking/AFURLResponseSerialization.m

@@ -529,7 +529,7 @@ id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingOptions
 
 #pragma mark -
 
-#if TARGET_OS_IOS || TARGET_OS_TV || TARGET_OS_WATCH
+#if TARGET_OS_IOS || TARGET_OS_TV || TARGET_OS_WATCH || TARGET_OS_VISION
 #import <CoreGraphics/CoreGraphics.h>
 #import <UIKit/UIKit.h>
 
@@ -691,8 +691,11 @@ static UIImage * AFInflatedImageFromResponseWithDataAtScale(NSHTTPURLResponse *r
             return nil;
         }
     }
-
-#if TARGET_OS_IOS || TARGET_OS_TV || TARGET_OS_WATCH
+    
+#if TARGET_OS_VISION
+    @throw [NSException exceptionWithName:NSInvalidArgumentException reason:@"TARGET_OS_VISION not implement" userInfo:nil];
+    return nil;
+#elif TARGET_OS_IOS || TARGET_OS_TV || TARGET_OS_WATCH
     if (self.automaticallyInflatesResponseImage) {
         return AFInflatedImageFromResponseWithDataAtScale((NSHTTPURLResponse *)response, data, self.imageScale);
     } else {