Skip to content

Commit 3217a55

Browse files
committed
support Mac Catalyst
1 parent a216b79 commit 3217a55

File tree

4 files changed

+18
-5
lines changed

4 files changed

+18
-5
lines changed

QiniuSDK/Common/QNALAssetFile.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#import "QNFileDelegate.h"
1212

1313
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED)
14+
#if !TARGET_OS_MACCATALYST
1415
@class ALAsset;
1516
@interface QNALAssetFile : NSObject <QNFileDelegate>
1617

@@ -26,3 +27,4 @@
2627
error:(NSError *__autoreleasing *)error;
2728
@end
2829
#endif
30+
#endif

QiniuSDK/Common/QNALAssetFile.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
#import "QNALAssetFile.h"
1010

1111
#ifdef __IPHONE_OS_VERSION_MAX_ALLOWED
12+
#if !TARGET_OS_MACCATALYST
1213
#import <AssetsLibrary/AssetsLibrary.h>
13-
1414
#import "QNResponseInfo.h"
1515

1616
@interface QNALAssetFile ()
@@ -84,3 +84,4 @@ - (int64_t)size {
8484
}
8585
@end
8686
#endif
87+
#endif

QiniuSDK/Storage/QNUploadManager.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,13 @@
1313
@class QNResponseInfo;
1414
@class QNUploadOption;
1515
@class QNConfiguration;
16-
@class ALAsset;
1716
@class PHAsset;
1817
@class PHAssetResource;
1918

19+
#if !TARGET_OS_MACCATALYST
20+
@class ALAsset;
21+
#endif
22+
2023
/**
2124
* 上传完成后的回调函数
2225
*
@@ -106,6 +109,7 @@ typedef void (^QNUpCompletionHandler)(QNResponseInfo *info, NSString *key, NSDic
106109
complete:(QNUpCompletionHandler)completionHandler
107110
option:(QNUploadOption *)option;
108111

112+
#if !TARGET_OS_MACCATALYST
109113
/**
110114
* 上传ALAsset文件
111115
*
@@ -120,6 +124,7 @@ typedef void (^QNUpCompletionHandler)(QNResponseInfo *info, NSString *key, NSDic
120124
token:(NSString *)token
121125
complete:(QNUpCompletionHandler)completionHandler
122126
option:(QNUploadOption *)option API_UNAVAILABLE(macos, tvos);
127+
#endif
123128

124129
/**
125130
* 上传PHAsset文件(IOS8 andLater)

QiniuSDK/Storage/QNUploadManager.m

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,20 @@
99
#import <Foundation/Foundation.h>
1010

1111
#if __IPHONE_OS_VERSION_MIN_REQUIRED
12-
#import "QNALAssetFile.h"
13-
#import <AssetsLibrary/AssetsLibrary.h>
1412
#import <MobileCoreServices/MobileCoreServices.h>
1513
#import <UIKit/UIKit.h>
1614

15+
#if !TARGET_OS_MACCATALYST
16+
#import <AssetsLibrary/AssetsLibrary.h>
17+
#import "QNALAssetFile.h"
18+
#endif
19+
1720
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000
1821
#import "QNPHAssetFile.h"
1922
#import <Photos/Photos.h>
2023
#endif
2124

22-
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 90100
25+
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 90000
2326
#import "QNPHAssetResource.h"
2427
#endif
2528

@@ -279,6 +282,7 @@ - (void)putFile:(NSString *)filePath
279282
}
280283
}
281284

285+
#if !TARGET_OS_MACCATALYST
282286
- (void)putALAsset:(ALAsset *)asset
283287
key:(NSString *)key
284288
token:(NSString *)token
@@ -303,6 +307,7 @@ - (void)putALAsset:(ALAsset *)asset
303307
}
304308
#endif
305309
}
310+
#endif
306311

307312
- (void)putPHAsset:(PHAsset *)asset
308313
key:(NSString *)key

0 commit comments

Comments
 (0)