From 46912090f92d277bc6627aec7126e1f5b1e675b2 Mon Sep 17 00:00:00 2001 From: DreamPiggy Date: Fri, 21 May 2021 11:47:36 +0800 Subject: [PATCH] Fix the warning, enable `APPLICATION_EXTENSION_API_ONLY` for all framework target --- Configs/Module-Shared.xcconfig | 3 +++ SDWebImage.xcodeproj/project.pbxproj | 4 ---- SDWebImage/Core/UIView+WebCache.m | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Configs/Module-Shared.xcconfig b/Configs/Module-Shared.xcconfig index ceeddec4..1b35da47 100644 --- a/Configs/Module-Shared.xcconfig +++ b/Configs/Module-Shared.xcconfig @@ -229,3 +229,6 @@ SUPPORTS_MACCATALYST = YES // macOS Catalyst support DERIVE_MACCATALYST_PRODUCT_BUNDLE_IDENTIFIER = NO + +// When enabled, this causes the compiler and linker to disallow use of APIs that are not available to app extensions and to disallow linking to frameworks that have not been built with this setting enabled. +APPLICATION_EXTENSION_API_ONLY = YES diff --git a/SDWebImage.xcodeproj/project.pbxproj b/SDWebImage.xcodeproj/project.pbxproj index 87e5bae1..3e7c95af 100644 --- a/SDWebImage.xcodeproj/project.pbxproj +++ b/SDWebImage.xcodeproj/project.pbxproj @@ -1337,7 +1337,6 @@ 4A2CAE131AB4BB5400B6BC39 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; INFOPLIST_FILE = WebImage/Info.plist; }; name = Debug; @@ -1345,7 +1344,6 @@ 4A2CAE141AB4BB5400B6BC39 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; INFOPLIST_FILE = WebImage/Info.plist; }; name = Release; @@ -1381,7 +1379,6 @@ 80B6DFEC2142B71600BCB334 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; INFOPLIST_FILE = WebImage/Info.plist; SUPPORTED_PLATFORMS = "macosx iphoneos iphonesimulator appletvsimulator appletvos"; TARGETED_DEVICE_FAMILY = "1,2,3"; @@ -1392,7 +1389,6 @@ 80B6DFED2142B71600BCB334 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; INFOPLIST_FILE = WebImage/Info.plist; SUPPORTED_PLATFORMS = "macosx iphoneos iphonesimulator appletvsimulator appletvos"; TARGETED_DEVICE_FAMILY = "1,2,3"; diff --git a/SDWebImage/Core/UIView+WebCache.m b/SDWebImage/Core/UIView+WebCache.m index d559b4cc..be33acac 100644 --- a/SDWebImage/Core/UIView+WebCache.m +++ b/SDWebImage/Core/UIView+WebCache.m @@ -283,7 +283,7 @@ const int64_t SDWebImageProgressUnitCountUnknown = 1LL; if (transition.prepares) { transition.prepares(view, image, imageData, cacheType, imageURL); } - } completion:^(BOOL finished) { + } completion:^(BOOL tempFinished) { [UIView transitionWithView:view duration:transition.duration options:transition.animationOptions animations:^{ if (!view.sd_latestOperationKey || ![originalOperationKey isEqualToString:view.sd_latestOperationKey]) { return;