diff --git a/Package.swift b/Package.swift index b2c34f9..91c33a1 100644 --- a/Package.swift +++ b/Package.swift @@ -25,8 +25,7 @@ let package = Package( .target( name: "SDWebImageSwiftUI", dependencies: ["SDWebImage"], - path: "SDWebImageSwiftUI/Classes", - exclude: ["ObjC"] + path: "SDWebImageSwiftUI/Classes" ), ] ) diff --git a/SDWebImageSwiftUI.podspec b/SDWebImageSwiftUI.podspec index 148274c..600aa55 100644 --- a/SDWebImageSwiftUI.podspec +++ b/SDWebImageSwiftUI.podspec @@ -27,6 +27,11 @@ It brings all your favorite features from SDWebImage, like async image loading, s.watchos.deployment_target = '6.0' 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.dependency 'SDWebImage', '~> 5.3' diff --git a/SDWebImageSwiftUI.xcodeproj/project.pbxproj b/SDWebImageSwiftUI.xcodeproj/project.pbxproj index fa37c7c..94f3aa6 100644 --- a/SDWebImageSwiftUI.xcodeproj/project.pbxproj +++ b/SDWebImageSwiftUI.xcodeproj/project.pbxproj @@ -500,6 +500,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + BUILD_LIBRARY_FOR_DISTRIBUTION = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; @@ -566,6 +567,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + BUILD_LIBRARY_FOR_DISTRIBUTION = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; diff --git a/SDWebImageSwiftUI/Classes/ImageViewWrapper.swift b/SDWebImageSwiftUI/Classes/ImageViewWrapper.swift index b5b4c16..a2e66a8 100644 --- a/SDWebImageSwiftUI/Classes/ImageViewWrapper.swift +++ b/SDWebImageSwiftUI/Classes/ImageViewWrapper.swift @@ -77,18 +77,18 @@ extension PlatformView { var sd_imageName: String? { get { - objc_getAssociatedObject(self, &UIView.sd_imageNameKey) as? String + objc_getAssociatedObject(self, &PlatformView.sd_imageNameKey) as? String } 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? { get { - objc_getAssociatedObject(self, &UIView.sd_imageDataKey) as? Data + objc_getAssociatedObject(self, &PlatformView.sd_imageDataKey) as? Data } set { - objc_setAssociatedObject(self, &UIView.sd_imageDataKey, newValue, .OBJC_ASSOCIATION_RETAIN_NONATOMIC) + objc_setAssociatedObject(self, &PlatformView.sd_imageDataKey, newValue, .OBJC_ASSOCIATION_RETAIN_NONATOMIC) } } }