From c0f796aa779e5e016be9a81bf96f8baca699c552 Mon Sep 17 00:00:00 2001 From: DreamPiggy Date: Thu, 27 Feb 2020 11:20:52 +0800 Subject: [PATCH] Try to fix the issue caused by Swift PM 5.2, the `sources` DSL only matches the individual source files, but not folder --- Package.swift | 18 ++++-------------- SDWebImage/MapKit/MKAnnotationView+WebCache.m | 8 ++------ 2 files changed, 6 insertions(+), 20 deletions(-) diff --git a/Package.swift b/Package.swift index 55da4f0b..50390b74 100644 --- a/Package.swift +++ b/Package.swift @@ -30,24 +30,14 @@ let package = Package( .target( name: "SDWebImage", dependencies: [], - path: ".", - sources: ["SDWebImage/Core", "SDWebImage/Private"], - publicHeadersPath: "SDWebImage/Core", - cSettings: [ - .headerSearchPath("SDWebImage/Core"), - .headerSearchPath("SDWebImage/Private") - ] + path: "SDWebImage", + exclude: ["MapKit"], + publicHeadersPath: "Core" ), .target( name: "SDWebImageMapKit", dependencies: ["SDWebImage"], - path: ".", - sources: ["SDWebImage/MapKit"], - publicHeadersPath: "SDWebImage/MapKit", - cSettings: [ - .headerSearchPath("SDWebImage/Core"), - .headerSearchPath("SDWebImage/Private") - ] + path: "SDWebImage/MapKit" ) ] ) diff --git a/SDWebImage/MapKit/MKAnnotationView+WebCache.m b/SDWebImage/MapKit/MKAnnotationView+WebCache.m index adc02a92..11b91b19 100644 --- a/SDWebImage/MapKit/MKAnnotationView+WebCache.m +++ b/SDWebImage/MapKit/MKAnnotationView+WebCache.m @@ -10,10 +10,7 @@ #if SD_UIKIT || SD_MAC -#import "objc/runtime.h" -#import "UIView+WebCacheOperation.h" #import "UIView+WebCache.h" -#import "SDInternalMacros.h" @implementation MKAnnotationView (WebCache) @@ -55,14 +52,13 @@ context:(nullable SDWebImageContext *)context progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock { - @weakify(self); + __weak typeof(self) wself = self; [self sd_internalSetImageWithURL:url placeholderImage:placeholder options:options context:context setImageBlock:^(UIImage * _Nullable image, NSData * _Nullable imageData, SDImageCacheType cacheType, NSURL * _Nullable imageURL) { - @strongify(self); - self.image = image; + wself.image = image; } progress:progressBlock completed:^(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, SDImageCacheType cacheType, BOOL finished, NSURL * _Nullable imageURL) {