Use the BUILD_LIBRARY_FOR_DISTRIBUTION to generate swift interface instead of Swift module

This commit is contained in:
DreamPiggy 2019-12-04 20:01:55 +08:00
parent 9061beace3
commit 056cc69713
4 changed files with 12 additions and 6 deletions

View File

@ -25,8 +25,7 @@ let package = Package(
.target( .target(
name: "SDWebImageSwiftUI", name: "SDWebImageSwiftUI",
dependencies: ["SDWebImage"], dependencies: ["SDWebImage"],
path: "SDWebImageSwiftUI/Classes", path: "SDWebImageSwiftUI/Classes"
exclude: ["ObjC"]
), ),
] ]
) )

View File

@ -27,6 +27,11 @@ It brings all your favorite features from SDWebImage, like async image loading,
s.watchos.deployment_target = '6.0' s.watchos.deployment_target = '6.0'
s.source_files = 'SDWebImageSwiftUI/Classes/**/*', 'SDWebImageSwiftUI/Module/*.h' s.source_files = 'SDWebImageSwiftUI/Classes/**/*', 'SDWebImageSwiftUI/Module/*.h'
s.pod_target_xcconfig = {
'SUPPORTS_MACCATALYST' => 'YES',
'DERIVE_MACCATALYST_PRODUCT_BUNDLE_IDENTIFIER' => 'NO',
'BUILD_LIBRARY_FOR_DISTRIBUTION' => 'YES'
}
s.frameworks = 'SwiftUI' s.frameworks = 'SwiftUI'
s.dependency 'SDWebImage', '~> 5.3' s.dependency 'SDWebImage', '~> 5.3'

View File

@ -500,6 +500,7 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
BUILD_LIBRARY_FOR_DISTRIBUTION = YES;
CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
@ -566,6 +567,7 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
BUILD_LIBRARY_FOR_DISTRIBUTION = YES;
CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";

View File

@ -77,18 +77,18 @@ extension PlatformView {
var sd_imageName: String? { var sd_imageName: String? {
get { get {
objc_getAssociatedObject(self, &UIView.sd_imageNameKey) as? String objc_getAssociatedObject(self, &PlatformView.sd_imageNameKey) as? String
} }
set { set {
objc_setAssociatedObject(self, &UIView.sd_imageNameKey, newValue, .OBJC_ASSOCIATION_RETAIN_NONATOMIC) objc_setAssociatedObject(self, &PlatformView.sd_imageNameKey, newValue, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
} }
} }
var sd_imageData: Data? { var sd_imageData: Data? {
get { get {
objc_getAssociatedObject(self, &UIView.sd_imageDataKey) as? Data objc_getAssociatedObject(self, &PlatformView.sd_imageDataKey) as? Data
} }
set { set {
objc_setAssociatedObject(self, &UIView.sd_imageDataKey, newValue, .OBJC_ASSOCIATION_RETAIN_NONATOMIC) objc_setAssociatedObject(self, &PlatformView.sd_imageDataKey, newValue, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
} }
} }
} }