Skip to content

Commit 341cd01

Browse files
authored
Merge pull request #15 from SDWebImage/project_backward_deployment
Supports to use this framework backward deployable on iOS 12/macOS 10.14-
2 parents 6a97d3e + dde632c commit 341cd01

7 files changed

Lines changed: 18 additions & 7 deletions

File tree

SDWebImageLinkPlugin.podspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,5 @@ SDWebImageLinkPlugin is a plugin for SDWebImage framework, which provide the ima
3737
}
3838

3939
s.dependency 'SDWebImage', '~> 5.4'
40+
s.weak_frameworks = 'LinkPresentation'
4041
end

SDWebImageLinkPlugin.xcodeproj/project.pbxproj

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
3253E0D02387E6B4007ACAD8 /* SDImageLinkLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 3253E0C72387E6B4007ACAD8 /* SDImageLinkLoader.h */; settings = {ATTRIBUTES = (Public, ); }; };
1515
3253E0D22387E6B4007ACAD8 /* SDWebImageLinkDefine.h in Headers */ = {isa = PBXBuildFile; fileRef = 3253E0C92387E6B4007ACAD8 /* SDWebImageLinkDefine.h */; settings = {ATTRIBUTES = (Public, ); }; };
1616
3253E0D32387E6B4007ACAD8 /* SDWebImageLinkError.m in Sources */ = {isa = PBXBuildFile; fileRef = 3253E0CA2387E6B4007ACAD8 /* SDWebImageLinkError.m */; };
17-
3253E0D62387E8C5007ACAD8 /* SDWebImage.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3253E0D52387E8C5007ACAD8 /* SDWebImage.framework */; };
18-
3253E0E72387E900007ACAD8 /* SDWebImage.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3253E0E62387E900007ACAD8 /* SDWebImage.framework */; };
17+
3253E0D62387E8C5007ACAD8 /* SDWebImage.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3253E0D52387E8C5007ACAD8 /* SDWebImage.framework */; settings = {ATTRIBUTES = (Required, ); }; };
18+
3253E0E72387E900007ACAD8 /* SDWebImage.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3253E0E62387E900007ACAD8 /* SDWebImage.framework */; settings = {ATTRIBUTES = (Required, ); }; };
1919
3253E0EC2387E94D007ACAD8 /* SDImageLinkLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 3253E0C72387E6B4007ACAD8 /* SDImageLinkLoader.h */; settings = {ATTRIBUTES = (Public, ); }; };
2020
3253E0ED2387E94D007ACAD8 /* SDImageLinkLoader.m in Sources */ = {isa = PBXBuildFile; fileRef = 3253E0C22387E6B4007ACAD8 /* SDImageLinkLoader.m */; };
2121
3253E0EE2387E94D007ACAD8 /* SDWebImageLinkDefine.h in Headers */ = {isa = PBXBuildFile; fileRef = 3253E0C92387E6B4007ACAD8 /* SDWebImageLinkDefine.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -31,6 +31,8 @@
3131
3253E13123882AD5007ACAD8 /* LPLinkView+WebCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 3253E12E23882AD5007ACAD8 /* LPLinkView+WebCache.m */; };
3232
3253E13223882AD5007ACAD8 /* LPLinkView+WebCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 3253E12F23882AD5007ACAD8 /* LPLinkView+WebCache.h */; settings = {ATTRIBUTES = (Public, ); }; };
3333
3253E13323882AD5007ACAD8 /* LPLinkView+WebCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 3253E12F23882AD5007ACAD8 /* LPLinkView+WebCache.h */; settings = {ATTRIBUTES = (Public, ); }; };
34+
3277599423C7035B0030A40A /* LinkPresentation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3277599323C7035B0030A40A /* LinkPresentation.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
35+
3277599523C703630030A40A /* LinkPresentation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3277599323C7035B0030A40A /* LinkPresentation.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
3436
/* End PBXBuildFile section */
3537

3638
/* Begin PBXFileReference section */
@@ -50,13 +52,15 @@
5052
3253E1252387EDE7007ACAD8 /* NSImage+SDWebImageLinkPlugin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSImage+SDWebImageLinkPlugin.h"; sourceTree = "<group>"; };
5153
3253E12E23882AD5007ACAD8 /* LPLinkView+WebCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "LPLinkView+WebCache.m"; sourceTree = "<group>"; };
5254
3253E12F23882AD5007ACAD8 /* LPLinkView+WebCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "LPLinkView+WebCache.h"; sourceTree = "<group>"; };
55+
3277599323C7035B0030A40A /* LinkPresentation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = LinkPresentation.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/LinkPresentation.framework; sourceTree = DEVELOPER_DIR; };
5356
/* End PBXFileReference section */
5457

5558
/* Begin PBXFrameworksBuildPhase section */
5659
3253E0B32387DCB2007ACAD8 /* Frameworks */ = {
5760
isa = PBXFrameworksBuildPhase;
5861
buildActionMask = 2147483647;
5962
files = (
63+
3277599423C7035B0030A40A /* LinkPresentation.framework in Frameworks */,
6064
3253E0D62387E8C5007ACAD8 /* SDWebImage.framework in Frameworks */,
6165
);
6266
runOnlyForDeploymentPostprocessing = 0;
@@ -65,6 +69,7 @@
6569
isa = PBXFrameworksBuildPhase;
6670
buildActionMask = 2147483647;
6771
files = (
72+
3277599523C703630030A40A /* LinkPresentation.framework in Frameworks */,
6873
3253E0E72387E900007ACAD8 /* SDWebImage.framework in Frameworks */,
6974
);
7075
runOnlyForDeploymentPostprocessing = 0;
@@ -120,6 +125,7 @@
120125
3253E0D42387E8C5007ACAD8 /* Frameworks */ = {
121126
isa = PBXGroup;
122127
children = (
128+
3277599323C7035B0030A40A /* LinkPresentation.framework */,
123129
3253E0E62387E900007ACAD8 /* SDWebImage.framework */,
124130
3253E0D52387E8C5007ACAD8 /* SDWebImage.framework */,
125131
);
@@ -279,6 +285,7 @@
279285
isa = XCBuildConfiguration;
280286
buildSettings = {
281287
ALWAYS_SEARCH_USER_PATHS = NO;
288+
APPLICATION_EXTENSION_API_ONLY = YES;
282289
CLANG_ANALYZER_NONNULL = YES;
283290
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
284291
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
@@ -341,6 +348,7 @@
341348
isa = XCBuildConfiguration;
342349
buildSettings = {
343350
ALWAYS_SEARCH_USER_PATHS = NO;
351+
APPLICATION_EXTENSION_API_ONLY = YES;
344352
CLANG_ANALYZER_NONNULL = YES;
345353
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
346354
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";

SDWebImageLinkPlugin/Classes/LPLinkView+WebCache.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
/**
1717
* Integrates SDWebImage async downloading and caching of remote images with LPLinkView.
1818
*/
19+
API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0))
1920
@interface LPLinkView (WebCache)
2021

2122
/**

SDWebImageLinkPlugin/Classes/NSImage+SDWebImageLinkPlugin.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#endif
1414

1515
#if SD_MAC
16-
16+
API_AVAILABLE(macos(10.15))
1717
/// Make NSImage supports the `NSItemProviderReading` as well as UIKit's UIImage
1818
@interface NSImage (SDWebImageLinkPlugin) <NSItemProviderReading, NSItemProviderWriting>
1919

SDWebImageLinkPlugin/Classes/SDImageLinkLoader.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#endif
1414

1515
/// A Rich Link loader by using the LinkPresentation framework, load any URL's rich link image, like Website URL, local file URL. See LinkPresentation framework description.
16+
API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0))
1617
@interface SDImageLinkLoader : NSObject <SDImageLoader>
1718

1819
/// Shared loader instance.

SDWebImageLinkPlugin/Classes/SDWebImageLinkDefine.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
A `LPLinkMetadata` object used to fetch image/icon for website. If you provide this value, we don't use `LPMetadataProvider` to fetch the website's metadata again, directlly use your prefetched metadata instead.
1717
@note If the provided `LPLinkMetadata` does not have any `imageProvider` or `iconProvider`, a error with code `SDWebImageLinkErrorNoImageProvider` will be returned. (`LPLinkMetadata`)
1818
*/
19-
FOUNDATION_EXPORT SDWebImageContextOption _Nonnull const SDWebImageContextLinkMetadata;
19+
FOUNDATION_EXPORT SDWebImageContextOption _Nonnull const SDWebImageContextLinkMetadata API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0));
2020

2121
/**
2222
A Bool value specify whether or not, to request the metadata's image, with the Data representation. But default we do not keep data by using `loadObjectOfClass` API. If enable, we'll use `loadDataRepresentationForTypeIdentifier` API instead, and decode the data into image object.
2323
@note Current implementation, LinkPresentation can retrive UIImage object 5x faster than the Data, so by default, we only request the image object witthout data. But it depends on your own usage, you can trun this on. (NSNumber *)
2424
*/
25-
FOUNDATION_EXPORT SDWebImageContextOption _Nonnull const SDWebImageContextLinkRequestImageData;
25+
FOUNDATION_EXPORT SDWebImageContextOption _Nonnull const SDWebImageContextLinkRequestImageData API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0));

SDWebImageLinkPlugin/Classes/SDWebImageLinkError.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
@import SDWebImage;
1313
#endif
1414

15-
FOUNDATION_EXPORT NSErrorDomain const SDWebImageLinkErrorDomain;
15+
FOUNDATION_EXPORT NSErrorDomain const SDWebImageLinkErrorDomain API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0));
1616

1717
typedef NS_ERROR_ENUM(SDWebImageLinkErrorDomain, SDWebImageLinkError) {
1818
/// Metadata have no any ImageProvider or IconProvider to query
1919
SDWebImageLinkErrorNoImageProvider = 10000,
20-
};
20+
} API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0));

0 commit comments

Comments
 (0)