From 93aa6d41d906644c412af4859cc08d0abba5b18a Mon Sep 17 00:00:00 2001 From: onevcat Date: Sun, 18 Aug 2019 23:29:08 +0900 Subject: [PATCH] Demo project for SwiftUI --- .../Kingfisher-SwiftUI-Demo/AppDelegate.swift | 2 +- .../SceneDelegate.swift | 2 +- .../Views/SwiftUIList.swift | 3 +- .../Views/SwiftUIView.swift | 2 +- .../Kingfisher-Demo.xcodeproj/project.pbxproj | 199 ++++++++++++- Kingfisher.xcodeproj/project.pbxproj | 280 +++++++++++++++++- .../xcschemes/KingfisherSwiftUI.xcscheme | 18 +- Package.swift | 3 +- Sources/Cache/Storage.swift | 13 +- Sources/SwiftUI/ImageBinder.swift | 4 +- Sources/SwiftUI/Info.plist | 22 -- Sources/SwiftUI/KFImage.swift | 6 - Sources/SwiftUI/KingfisherSwiftUI.h | 37 --- Sources/Views/Indicator.swift | 15 +- 14 files changed, 509 insertions(+), 97 deletions(-) delete mode 100644 Sources/SwiftUI/Info.plist delete mode 100644 Sources/SwiftUI/KingfisherSwiftUI.h diff --git a/Demo/Demo/Kingfisher-SwiftUI-Demo/AppDelegate.swift b/Demo/Demo/Kingfisher-SwiftUI-Demo/AppDelegate.swift index 593b498cc..fe1c41661 100644 --- a/Demo/Demo/Kingfisher-SwiftUI-Demo/AppDelegate.swift +++ b/Demo/Demo/Kingfisher-SwiftUI-Demo/AppDelegate.swift @@ -2,7 +2,7 @@ // AppDelegate.swift // Kingfisher // -// Created by jp20028 on 2019/08/07. +// Created by onevcat on 2019/08/18. // // Copyright (c) 2019 Wei Wang // diff --git a/Demo/Demo/Kingfisher-SwiftUI-Demo/SceneDelegate.swift b/Demo/Demo/Kingfisher-SwiftUI-Demo/SceneDelegate.swift index 614413ad6..c13153260 100644 --- a/Demo/Demo/Kingfisher-SwiftUI-Demo/SceneDelegate.swift +++ b/Demo/Demo/Kingfisher-SwiftUI-Demo/SceneDelegate.swift @@ -2,7 +2,7 @@ // SceneDelegate.swift // Kingfisher // -// Created by jp20028 on 2019/08/07. +// Created by onevcat on 2019/08/18. // // Copyright (c) 2019 Wei Wang // diff --git a/Demo/Demo/Kingfisher-SwiftUI-Demo/Views/SwiftUIList.swift b/Demo/Demo/Kingfisher-SwiftUI-Demo/Views/SwiftUIList.swift index eca3bfc98..45672d4be 100644 --- a/Demo/Demo/Kingfisher-SwiftUI-Demo/Views/SwiftUIList.swift +++ b/Demo/Demo/Kingfisher-SwiftUI-Demo/Views/SwiftUIList.swift @@ -24,7 +24,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import KingfisherSwiftUI +import Kingfisher import SwiftUI struct SwiftUIList : View { @@ -35,7 +35,6 @@ struct SwiftUIList : View { List(index) { i in HStack(alignment: .center) { Spacer() - KFImage( URL(string: "https://github.com/onevcat/Flower-Data-Set/raw/master/rose/rose-\(i).jpg")!, options: [.transition(.fade(0.4))] diff --git a/Demo/Demo/Kingfisher-SwiftUI-Demo/Views/SwiftUIView.swift b/Demo/Demo/Kingfisher-SwiftUI-Demo/Views/SwiftUIView.swift index b1a5cfd88..0f2d95af2 100644 --- a/Demo/Demo/Kingfisher-SwiftUI-Demo/Views/SwiftUIView.swift +++ b/Demo/Demo/Kingfisher-SwiftUI-Demo/Views/SwiftUIView.swift @@ -24,7 +24,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import KingfisherSwiftUI +import Kingfisher import SwiftUI struct SwiftUIView : View { diff --git a/Demo/Kingfisher-Demo.xcodeproj/project.pbxproj b/Demo/Kingfisher-Demo.xcodeproj/project.pbxproj index 9e1cf990e..7ad75a401 100644 --- a/Demo/Kingfisher-Demo.xcodeproj/project.pbxproj +++ b/Demo/Kingfisher-Demo.xcodeproj/project.pbxproj @@ -22,6 +22,7 @@ 4BCCF3401D5B02F8003387C2 /* Cell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4BCCF33A1D5B02F8003387C2 /* Cell.xib */; }; 4BCCF3421D5B02F8003387C2 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BCCF33C1D5B02F8003387C2 /* ViewController.swift */; }; C959EEE622874DC600467A10 /* ProgressiveJPEGViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C959EEE522874DC600467A10 /* ProgressiveJPEGViewController.swift */; }; + D10402B8230997E400B3D4CB /* Kingfisher.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D10402B7230997E400B3D4CB /* Kingfisher.framework */; }; D10AC99821A300C9005F057C /* ProcessorCollectionViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D10AC99721A300C9005F057C /* ProcessorCollectionViewController.swift */; }; D12E0C951C47F91800AC98AD /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D12E0C8C1C47F91800AC98AD /* AppDelegate.swift */; }; D12E0C961C47F91800AC98AD /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = D12E0C8D1C47F91800AC98AD /* LaunchScreen.xib */; }; @@ -53,6 +54,14 @@ D1F06F3521AA5938000B1C38 /* ImageCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D12E0C911C47F91800AC98AD /* ImageCollectionViewCell.swift */; }; D1F06F3721AAEACF000B1C38 /* GIFViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1F06F3621AAEACF000B1C38 /* GIFViewController.swift */; }; D1F06F3921AAF1EE000B1C38 /* IndicatorCollectionViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1F06F3821AAF1EE000B1C38 /* IndicatorCollectionViewController.swift */; }; + D1F760B623098FA2000C5269 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D1F760AA23098FA2000C5269 /* Assets.xcassets */; }; + D1F760B723098FA2000C5269 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D1F760AC23098FA2000C5269 /* Preview Assets.xcassets */; }; + D1F760B823098FA2000C5269 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D1F760AD23098FA2000C5269 /* LaunchScreen.storyboard */; }; + D1F760B923098FA2000C5269 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1F760AF23098FA2000C5269 /* AppDelegate.swift */; }; + D1F760BA23098FA2000C5269 /* MainView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1F760B023098FA2000C5269 /* MainView.swift */; }; + D1F760BB23098FA2000C5269 /* SwiftUIList.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1F760B223098FA2000C5269 /* SwiftUIList.swift */; }; + D1F760BC23098FA2000C5269 /* SwiftUIView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1F760B323098FA2000C5269 /* SwiftUIView.swift */; }; + D1F760BE23098FA2000C5269 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1F760B523098FA2000C5269 /* SceneDelegate.swift */; }; D1FAB06F21A853E600908910 /* HighResolutionCollectionViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1FAB06E21A853E600908910 /* HighResolutionCollectionViewController.swift */; }; /* End PBXBuildFile section */ @@ -85,6 +94,16 @@ name = "Embed Watch Content"; runOnlyForDeploymentPostprocessing = 0; }; + D10402B6230996BE00B3D4CB /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; D12F2EEC1C4E7CF500B8054D /* Embed Frameworks */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; @@ -149,6 +168,9 @@ 4BCCF33B1D5B02F8003387C2 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 4BCCF33C1D5B02F8003387C2 /* ViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; C959EEE522874DC600467A10 /* ProgressiveJPEGViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProgressiveJPEGViewController.swift; sourceTree = ""; }; + D10402B2230996B600B3D4CB /* KingfisherUI.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = KingfisherUI.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + D10402B7230997E400B3D4CB /* Kingfisher.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Kingfisher.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + D10402B9230997EA00B3D4CB /* Kingfisher.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Kingfisher.framework; path = "../../../../Library/Developer/Xcode/DerivedData/Kingfisher-fotthknjplbnsahkfikwhzhqdaau/Build/Products/Debug-iphonesimulator/Kingfisher.framework"; sourceTree = ""; }; D10AC99721A300C9005F057C /* ProcessorCollectionViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProcessorCollectionViewController.swift; sourceTree = ""; }; D12E0C8C1C47F91800AC98AD /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; D12E0C8E1C47F91800AC98AD /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; @@ -177,6 +199,16 @@ D1F06F3221AA4292000B1C38 /* DetailImageViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DetailImageViewController.swift; sourceTree = ""; }; D1F06F3621AAEACF000B1C38 /* GIFViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GIFViewController.swift; sourceTree = ""; }; D1F06F3821AAF1EE000B1C38 /* IndicatorCollectionViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IndicatorCollectionViewController.swift; sourceTree = ""; }; + D1F7609523098F62000C5269 /* Kingfisher-SwiftUI-Demo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Kingfisher-SwiftUI-Demo.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + D1F760AA23098FA2000C5269 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + D1F760AC23098FA2000C5269 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + D1F760AE23098FA2000C5269 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + D1F760AF23098FA2000C5269 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + D1F760B023098FA2000C5269 /* MainView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MainView.swift; sourceTree = ""; }; + D1F760B223098FA2000C5269 /* SwiftUIList.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwiftUIList.swift; sourceTree = ""; }; + D1F760B323098FA2000C5269 /* SwiftUIView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwiftUIView.swift; sourceTree = ""; }; + D1F760B423098FA2000C5269 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + D1F760B523098FA2000C5269 /* SceneDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; D1FAB06E21A853E600908910 /* HighResolutionCollectionViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HighResolutionCollectionViewController.swift; sourceTree = ""; }; /* End PBXFileReference section */ @@ -220,12 +252,22 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + D1F7609223098F62000C5269 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + D10402B8230997E400B3D4CB /* Kingfisher.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ 277EAE762045ADE700547CD3 /* Frameworks */ = { isa = PBXGroup; children = ( + D10402B7230997E400B3D4CB /* Kingfisher.framework */, + D10402B2230996B600B3D4CB /* KingfisherUI.framework */, D17176402047837900EFC8C5 /* Kingfisher.framework */, D1717639204782D500EFC8C5 /* Kingfisher.framework */, D1717636204782AE00EFC8C5 /* Kingfisher.framework */, @@ -274,6 +316,7 @@ D10EC22B1C3D62DE00A4211C /* Demo */ = { isa = PBXGroup; children = ( + D1F760A923098FA2000C5269 /* Kingfisher-SwiftUI-Demo */, D12E0C8B1C47F91800AC98AD /* Kingfisher-Demo */, 4BCCF3351D5B02F8003387C2 /* Kingfisher-macOS-Demo */, D12E0C9C1C47F92200AC98AD /* Kingfisher-tvOS-Demo */, @@ -350,6 +393,7 @@ D1ED2D021AD2CFA600CFC3EB = { isa = PBXGroup; children = ( + D10402B9230997EA00B3D4CB /* Kingfisher.framework */, D10EC22B1C3D62DE00A4211C /* Demo */, D1ED2D0C1AD2CFA600CFC3EB /* Products */, 277EAE762045ADE700547CD3 /* Frameworks */, @@ -364,10 +408,44 @@ 4B2944551C3D03880088C3E7 /* Kingfisher-macOS-Demo.app */, D1679A391C4E78B20020FD12 /* Kingfisher-watchOS-Demo.app */, D1679A451C4E78B20020FD12 /* Kingfisher-watchOS-Demo Extension.appex */, + D1F7609523098F62000C5269 /* Kingfisher-SwiftUI-Demo.app */, ); name = Products; sourceTree = ""; }; + D1F760A923098FA2000C5269 /* Kingfisher-SwiftUI-Demo */ = { + isa = PBXGroup; + children = ( + D1F760AA23098FA2000C5269 /* Assets.xcassets */, + D1F760AB23098FA2000C5269 /* Preview Content */, + D1F760AD23098FA2000C5269 /* LaunchScreen.storyboard */, + D1F760AF23098FA2000C5269 /* AppDelegate.swift */, + D1F760B023098FA2000C5269 /* MainView.swift */, + D1F760B123098FA2000C5269 /* Views */, + D1F760B423098FA2000C5269 /* Info.plist */, + D1F760B523098FA2000C5269 /* SceneDelegate.swift */, + ); + name = "Kingfisher-SwiftUI-Demo"; + path = "Demo/Kingfisher-SwiftUI-Demo"; + sourceTree = ""; + }; + D1F760AB23098FA2000C5269 /* Preview Content */ = { + isa = PBXGroup; + children = ( + D1F760AC23098FA2000C5269 /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; + D1F760B123098FA2000C5269 /* Views */ = { + isa = PBXGroup; + children = ( + D1F760B223098FA2000C5269 /* SwiftUIList.swift */, + D1F760B323098FA2000C5269 /* SwiftUIView.swift */, + ); + path = Views; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -462,13 +540,31 @@ productReference = D1ED2D0B1AD2CFA600CFC3EB /* Kingfisher-Demo.app */; productType = "com.apple.product-type.application"; }; + D1F7609423098F62000C5269 /* Kingfisher-SwiftUI-Demo */ = { + isa = PBXNativeTarget; + buildConfigurationList = D1F760A623098F63000C5269 /* Build configuration list for PBXNativeTarget "Kingfisher-SwiftUI-Demo" */; + buildPhases = ( + D1F7609123098F62000C5269 /* Sources */, + D1F7609223098F62000C5269 /* Frameworks */, + D1F7609323098F62000C5269 /* Resources */, + D10402B6230996BE00B3D4CB /* Embed Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Kingfisher-SwiftUI-Demo"; + productName = "Kingfisher-SwiftUI-Demo"; + productReference = D1F7609523098F62000C5269 /* Kingfisher-SwiftUI-Demo.app */; + productType = "com.apple.product-type.application"; + }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ D1ED2D031AD2CFA600CFC3EB /* Project object */ = { isa = PBXProject; attributes = { - LastSwiftUpdateCheck = 0720; + LastSwiftUpdateCheck = 1100; LastUpgradeCheck = 1100; ORGANIZATIONNAME = "Wei Wang"; TargetAttributes = { @@ -500,6 +596,11 @@ DevelopmentTeam = T499X543T7; LastSwiftMigration = 0900; }; + D1F7609423098F62000C5269 = { + CreatedOnToolsVersion = 11.0; + DevelopmentTeam = A4YJ9MRZ66; + ProvisioningStyle = Automatic; + }; }; }; buildConfigurationList = D1ED2D061AD2CFA600CFC3EB /* Build configuration list for PBXProject "Kingfisher-Demo" */; @@ -518,6 +619,7 @@ D1ED2D0A1AD2CFA600CFC3EB /* Kingfisher-Demo */, D13F49C11BEDA53F00CE335D /* Kingfisher-tvOS-Demo */, 4B2944541C3D03880088C3E7 /* Kingfisher-macOS-Demo */, + D1F7609423098F62000C5269 /* Kingfisher-SwiftUI-Demo */, D1679A381C4E78B20020FD12 /* Kingfisher-watchOS-Demo */, D1679A441C4E78B20020FD12 /* Kingfisher-watchOS-Demo Extension */, ); @@ -574,6 +676,16 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + D1F7609323098F62000C5269 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + D1F760B823098FA2000C5269 /* LaunchScreen.storyboard in Resources */, + D1F760B723098FA2000C5269 /* Preview Assets.xcassets in Resources */, + D1F760B623098FA2000C5269 /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -629,6 +741,18 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + D1F7609123098F62000C5269 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + D1F760BE23098FA2000C5269 /* SceneDelegate.swift in Sources */, + D1F760B923098FA2000C5269 /* AppDelegate.swift in Sources */, + D1F760BB23098FA2000C5269 /* SwiftUIList.swift in Sources */, + D1F760BC23098FA2000C5269 /* SwiftUIView.swift in Sources */, + D1F760BA23098FA2000C5269 /* MainView.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ @@ -685,6 +809,14 @@ name = Main.storyboard; sourceTree = ""; }; + D1F760AD23098FA2000C5269 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + D1F760AE23098FA2000C5269 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ @@ -990,6 +1122,62 @@ }; name = Release; }; + D1F760A723098F63000C5269 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_STYLE = Automatic; + DEBUG_INFORMATION_FORMAT = dwarf; + DEVELOPMENT_ASSET_PATHS = "Demo/Kingfisher-SwiftUI-Demo/Preview\\ Content"; + DEVELOPMENT_TEAM = A4YJ9MRZ66; + ENABLE_PREVIEWS = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + INFOPLIST_FILE = "Demo/Kingfisher-SwiftUI-Demo/Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = "com.onevcat.Kingfisher-SwiftUI-Demo"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + D1F760A823098F63000C5269 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_STYLE = Automatic; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEVELOPMENT_ASSET_PATHS = "Demo/Kingfisher-SwiftUI-Demo/Preview\\ Content"; + DEVELOPMENT_TEAM = A4YJ9MRZ66; + ENABLE_PREVIEWS = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + INFOPLIST_FILE = "Demo/Kingfisher-SwiftUI-Demo/Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = "com.onevcat.Kingfisher-SwiftUI-Demo"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -1047,6 +1235,15 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + D1F760A623098F63000C5269 /* Build configuration list for PBXNativeTarget "Kingfisher-SwiftUI-Demo" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + D1F760A723098F63000C5269 /* Debug */, + D1F760A823098F63000C5269 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; /* End XCConfigurationList section */ }; rootObject = D1ED2D031AD2CFA600CFC3EB /* Project object */; diff --git a/Kingfisher.xcodeproj/project.pbxproj b/Kingfisher.xcodeproj/project.pbxproj index 08d9fbad2..57857a63c 100644 --- a/Kingfisher.xcodeproj/project.pbxproj +++ b/Kingfisher.xcodeproj/project.pbxproj @@ -102,6 +102,56 @@ D1E564412199C21E0057AAE3 /* StorageExpirationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1E564402199C21E0057AAE3 /* StorageExpirationTests.swift */; }; D1E56445219B16330057AAE3 /* ImageDataProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1E56444219B16330057AAE3 /* ImageDataProvider.swift */; }; D1ED2D401AD2D09F00CFC3EB /* Kingfisher.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D1ED2D351AD2D09F00CFC3EB /* Kingfisher.framework */; }; + D1F7603D230974DE000C5269 /* ImageModifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = D12AB6A0215D2BB50013BA68 /* ImageModifier.swift */; }; + D1F7603E230974DE000C5269 /* CacheSerializer.swift in Sources */ = {isa = PBXBuildFile; fileRef = D12AB6B7215D2BB50013BA68 /* CacheSerializer.swift */; }; + D1F7603F230974DE000C5269 /* ImageDataProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1E56444219B16330057AAE3 /* ImageDataProvider.swift */; }; + D1F76040230974DE000C5269 /* AnimatedImageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D12AB6BF215D2BB50013BA68 /* AnimatedImageView.swift */; }; + D1F76041230974DE000C5269 /* Storage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B46CC63217449E000D90C4A /* Storage.swift */; }; + D1F76042230974DE000C5269 /* Placeholder.swift in Sources */ = {isa = PBXBuildFile; fileRef = D12AB6A7215D2BB50013BA68 /* Placeholder.swift */; }; + D1F76043230974DE000C5269 /* DiskStorage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B46CC6821744AC500D90C4A /* DiskStorage.swift */; }; + D1F76044230974DE000C5269 /* MemoryStorage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B46CC5E217449C600D90C4A /* MemoryStorage.swift */; }; + D1F76045230974DE000C5269 /* Delegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1839844216E333E003927D3 /* Delegate.swift */; }; + D1F76046230974DE000C5269 /* ImageTransition.swift in Sources */ = {isa = PBXBuildFile; fileRef = D12AB6A4215D2BB50013BA68 /* ImageTransition.swift */; }; + D1F76047230974DE000C5269 /* ExtensionHelpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1A37BE7215D365A009B39B7 /* ExtensionHelpers.swift */; }; + D1F76048230974DE000C5269 /* ImageProgressive.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9286406228584EB00257182 /* ImageProgressive.swift */; }; + D1F76049230974DE000C5269 /* ImageProcessor.swift in Sources */ = {isa = PBXBuildFile; fileRef = D12AB6A5215D2BB50013BA68 /* ImageProcessor.swift */; }; + D1F7604A230974DE000C5269 /* Image.swift in Sources */ = {isa = PBXBuildFile; fileRef = D12AB6A3215D2BB50013BA68 /* Image.swift */; }; + D1F7604B230974DE000C5269 /* String+MD5.swift in Sources */ = {isa = PBXBuildFile; fileRef = D12AB6BC215D2BB50013BA68 /* String+MD5.swift */; }; + D1F7604C230974DE000C5269 /* ImageDownloaderDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B8E2916216F3F7F0095FAD1 /* ImageDownloaderDelegate.swift */; }; + D1F7604D230974DE000C5269 /* Kingfisher.swift in Sources */ = {isa = PBXBuildFile; fileRef = D12AB6B1215D2BB50013BA68 /* Kingfisher.swift */; }; + D1F7604E230974DE000C5269 /* CallbackQueue.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1BA781C2174D07800C69D7B /* CallbackQueue.swift */; }; + D1F7604F230974DE000C5269 /* FormatIndicatedCacheSerializer.swift in Sources */ = {isa = PBXBuildFile; fileRef = D12AB6B8215D2BB50013BA68 /* FormatIndicatedCacheSerializer.swift */; }; + D1F76050230974DE000C5269 /* SizeExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1A37BF1215D3850009B39B7 /* SizeExtensions.swift */; }; + D1F76051230974DE000C5269 /* KingfisherManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = D12AB6B3215D2BB50013BA68 /* KingfisherManager.swift */; }; + D1F76052230974DE000C5269 /* Runtime.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B8351CB217084660081EED8 /* Runtime.swift */; }; + D1F76053230974DE000C5269 /* RequestModifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = D12AB69D215D2BB50013BA68 /* RequestModifier.swift */; }; + D1F76054230974DE000C5269 /* ImageDataProcessor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B10480C216F157000300C61 /* ImageDataProcessor.swift */; }; + D1F76055230974DE000C5269 /* Indicator.swift in Sources */ = {isa = PBXBuildFile; fileRef = D12AB6BE215D2BB50013BA68 /* Indicator.swift */; }; + D1F76056230974DE000C5269 /* ImageDownloader.swift in Sources */ = {isa = PBXBuildFile; fileRef = D12AB69F215D2BB50013BA68 /* ImageDownloader.swift */; }; + D1F76057230974DE000C5269 /* ImageFormat.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1A37BE2215D359F009B39B7 /* ImageFormat.swift */; }; + D1F76058230974DE000C5269 /* ImageCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = D12AB6B6215D2BB50013BA68 /* ImageCache.swift */; }; + D1F76059230974DE000C5269 /* ImagePrefetcher.swift in Sources */ = {isa = PBXBuildFile; fileRef = D12AB6A1215D2BB50013BA68 /* ImagePrefetcher.swift */; }; + D1F7605A230974DE000C5269 /* ImageView+Kingfisher.swift in Sources */ = {isa = PBXBuildFile; fileRef = D12AB6AC215D2BB50013BA68 /* ImageView+Kingfisher.swift */; }; + D1F7605B230974DE000C5269 /* UIButton+Kingfisher.swift in Sources */ = {isa = PBXBuildFile; fileRef = D12AB6AE215D2BB50013BA68 /* UIButton+Kingfisher.swift */; }; + D1F7605C230974DE000C5269 /* GIFAnimatedImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = D12AB6A8215D2BB50013BA68 /* GIFAnimatedImage.swift */; }; + D1F7605D230974DE000C5269 /* Result.swift in Sources */ = {isa = PBXBuildFile; fileRef = D13646732165A1A100A33652 /* Result.swift */; }; + D1F7605E230974DE000C5269 /* Source.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1A1CC99219FAB4B00263AD8 /* Source.swift */; }; + D1F7605F230974DE000C5269 /* SessionDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BD821612189FC0C0084CC21 /* SessionDelegate.swift */; }; + D1F76060230974DE000C5269 /* Filter.swift in Sources */ = {isa = PBXBuildFile; fileRef = D12AB6A6215D2BB50013BA68 /* Filter.swift */; }; + D1F76061230974DE000C5269 /* NSButton+Kingfisher.swift in Sources */ = {isa = PBXBuildFile; fileRef = D12AB6AD215D2BB50013BA68 /* NSButton+Kingfisher.swift */; }; + D1F76062230974DE000C5269 /* Resource.swift in Sources */ = {isa = PBXBuildFile; fileRef = D12AB69E215D2BB50013BA68 /* Resource.swift */; }; + D1F76063230974DE000C5269 /* RedirectHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8FCF6A721C5A0E500F9ABC0 /* RedirectHandler.swift */; }; + D1F76064230974DE000C5269 /* ImageDrawing.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1A37BDD215D34E8009B39B7 /* ImageDrawing.swift */; }; + D1F76065230974DE000C5269 /* SessionDataTask.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BD821662189FD330084CC21 /* SessionDataTask.swift */; }; + D1F76066230974DE000C5269 /* KingfisherError.swift in Sources */ = {isa = PBXBuildFile; fileRef = D12AB6B2215D2BB50013BA68 /* KingfisherError.swift */; }; + D1F76067230974DE000C5269 /* Deprecated.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1A37BEC215D375F009B39B7 /* Deprecated.swift */; }; + D1F76068230974DE000C5269 /* WKInterfaceImage+Kingfisher.swift in Sources */ = {isa = PBXBuildFile; fileRef = D12AB6AF215D2BB50013BA68 /* WKInterfaceImage+Kingfisher.swift */; }; + D1F76069230974DE000C5269 /* Box.swift in Sources */ = {isa = PBXBuildFile; fileRef = D12AB6BB215D2BB50013BA68 /* Box.swift */; }; + D1F7606A230974DE000C5269 /* AuthenticationChallengeResponsable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B8E291B216F40AA0095FAD1 /* AuthenticationChallengeResponsable.swift */; }; + D1F7606B230974DE000C5269 /* KingfisherOptionsInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D12AB6B4215D2BB50013BA68 /* KingfisherOptionsInfo.swift */; }; + D1F7606E230974DE000C5269 /* Kingfisher.h in Headers */ = {isa = PBXBuildFile; fileRef = D12AB6AA215D2BB50013BA68 /* Kingfisher.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D1F7607723097533000C5269 /* ImageBinder.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1F7607523097532000C5269 /* ImageBinder.swift */; }; + D1F7607823097533000C5269 /* KFImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1F7607623097532000C5269 /* KFImage.swift */; }; D8FCF6A821C5A0E500F9ABC0 /* RedirectHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8FCF6A721C5A0E500F9ABC0 /* RedirectHandler.swift */; }; D9638BA61C7DC71F0046523D /* ImagePrefetcherTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D9638BA41C7DC71F0046523D /* ImagePrefetcherTests.swift */; }; F72CE9CE1FCF17ED00CC522A /* ImageModifierTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F72CE9CD1FCF17ED00CC522A /* ImageModifierTests.swift */; }; @@ -250,6 +300,9 @@ D1E56444219B16330057AAE3 /* ImageDataProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = ImageDataProvider.swift; path = Sources/General/ImageSource/ImageDataProvider.swift; sourceTree = SOURCE_ROOT; }; D1ED2D351AD2D09F00CFC3EB /* Kingfisher.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Kingfisher.framework; sourceTree = BUILT_PRODUCTS_DIR; }; D1ED2D3F1AD2D09F00CFC3EB /* KingfisherTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = KingfisherTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + D1F76072230974DE000C5269 /* Kingfisher.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Kingfisher.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + D1F7607523097532000C5269 /* ImageBinder.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImageBinder.swift; sourceTree = ""; }; + D1F7607623097532000C5269 /* KFImage.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KFImage.swift; sourceTree = ""; }; D8FCF6A721C5A0E500F9ABC0 /* RedirectHandler.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RedirectHandler.swift; sourceTree = ""; }; D9638BA41C7DC71F0046523D /* ImagePrefetcherTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImagePrefetcherTests.swift; sourceTree = ""; }; F72CE9CD1FCF17ED00CC522A /* ImageModifierTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImageModifierTests.swift; sourceTree = ""; }; @@ -271,6 +324,13 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + D1F7606C230974DE000C5269 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ @@ -303,6 +363,7 @@ D12AB6BD215D2BB50013BA68 /* Views */, D12AB6AB215D2BB50013BA68 /* Extensions */, D12AB6B9215D2BB50013BA68 /* Utility */, + D1F7607423097532000C5269 /* SwiftUI */, ); path = Sources; sourceTree = ""; @@ -619,10 +680,20 @@ children = ( D1ED2D351AD2D09F00CFC3EB /* Kingfisher.framework */, D1ED2D3F1AD2D09F00CFC3EB /* KingfisherTests.xctest */, + D1F76072230974DE000C5269 /* Kingfisher.framework */, ); name = Products; sourceTree = ""; }; + D1F7607423097532000C5269 /* SwiftUI */ = { + isa = PBXGroup; + children = ( + D1F7607523097532000C5269 /* ImageBinder.swift */, + D1F7607623097532000C5269 /* KFImage.swift */, + ); + path = SwiftUI; + sourceTree = ""; + }; EA99D30544BD22799F7A5367 /* Frameworks */ = { isa = PBXGroup; children = ( @@ -644,6 +715,14 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + D1F7606D230974DE000C5269 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + D1F7606E230974DE000C5269 /* Kingfisher.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ @@ -682,6 +761,23 @@ productReference = D1ED2D3F1AD2D09F00CFC3EB /* KingfisherTests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; + D1F7603B230974DE000C5269 /* KingfisherSwiftUI */ = { + isa = PBXNativeTarget; + buildConfigurationList = D1F7606F230974DE000C5269 /* Build configuration list for PBXNativeTarget "KingfisherSwiftUI" */; + buildPhases = ( + D1F7603C230974DE000C5269 /* Sources */, + D1F7606C230974DE000C5269 /* Frameworks */, + D1F7606D230974DE000C5269 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = KingfisherSwiftUI; + productName = Kingfisher; + productReference = D1F76072230974DE000C5269 /* Kingfisher.framework */; + productType = "com.apple.product-type.framework"; + }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ @@ -717,6 +813,7 @@ projectRoot = ""; targets = ( D1ED2D341AD2D09F00CFC3EB /* Kingfisher */, + D1F7603B230974DE000C5269 /* KingfisherSwiftUI */, D1ED2D3E1AD2D09F00CFC3EB /* KingfisherTests */, ); }; @@ -843,6 +940,62 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + D1F7603C230974DE000C5269 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + D1F7603D230974DE000C5269 /* ImageModifier.swift in Sources */, + D1F7603E230974DE000C5269 /* CacheSerializer.swift in Sources */, + D1F7603F230974DE000C5269 /* ImageDataProvider.swift in Sources */, + D1F76040230974DE000C5269 /* AnimatedImageView.swift in Sources */, + D1F7607823097533000C5269 /* KFImage.swift in Sources */, + D1F76041230974DE000C5269 /* Storage.swift in Sources */, + D1F76042230974DE000C5269 /* Placeholder.swift in Sources */, + D1F76043230974DE000C5269 /* DiskStorage.swift in Sources */, + D1F76044230974DE000C5269 /* MemoryStorage.swift in Sources */, + D1F76045230974DE000C5269 /* Delegate.swift in Sources */, + D1F76046230974DE000C5269 /* ImageTransition.swift in Sources */, + D1F76047230974DE000C5269 /* ExtensionHelpers.swift in Sources */, + D1F76048230974DE000C5269 /* ImageProgressive.swift in Sources */, + D1F76049230974DE000C5269 /* ImageProcessor.swift in Sources */, + D1F7604A230974DE000C5269 /* Image.swift in Sources */, + D1F7604B230974DE000C5269 /* String+MD5.swift in Sources */, + D1F7604C230974DE000C5269 /* ImageDownloaderDelegate.swift in Sources */, + D1F7604D230974DE000C5269 /* Kingfisher.swift in Sources */, + D1F7604E230974DE000C5269 /* CallbackQueue.swift in Sources */, + D1F7604F230974DE000C5269 /* FormatIndicatedCacheSerializer.swift in Sources */, + D1F76050230974DE000C5269 /* SizeExtensions.swift in Sources */, + D1F76051230974DE000C5269 /* KingfisherManager.swift in Sources */, + D1F76052230974DE000C5269 /* Runtime.swift in Sources */, + D1F76053230974DE000C5269 /* RequestModifier.swift in Sources */, + D1F76054230974DE000C5269 /* ImageDataProcessor.swift in Sources */, + D1F76055230974DE000C5269 /* Indicator.swift in Sources */, + D1F76056230974DE000C5269 /* ImageDownloader.swift in Sources */, + D1F76057230974DE000C5269 /* ImageFormat.swift in Sources */, + D1F76058230974DE000C5269 /* ImageCache.swift in Sources */, + D1F76059230974DE000C5269 /* ImagePrefetcher.swift in Sources */, + D1F7605A230974DE000C5269 /* ImageView+Kingfisher.swift in Sources */, + D1F7605B230974DE000C5269 /* UIButton+Kingfisher.swift in Sources */, + D1F7605C230974DE000C5269 /* GIFAnimatedImage.swift in Sources */, + D1F7605D230974DE000C5269 /* Result.swift in Sources */, + D1F7605E230974DE000C5269 /* Source.swift in Sources */, + D1F7605F230974DE000C5269 /* SessionDelegate.swift in Sources */, + D1F7607723097533000C5269 /* ImageBinder.swift in Sources */, + D1F76060230974DE000C5269 /* Filter.swift in Sources */, + D1F76061230974DE000C5269 /* NSButton+Kingfisher.swift in Sources */, + D1F76062230974DE000C5269 /* Resource.swift in Sources */, + D1F76063230974DE000C5269 /* RedirectHandler.swift in Sources */, + D1F76064230974DE000C5269 /* ImageDrawing.swift in Sources */, + D1F76065230974DE000C5269 /* SessionDataTask.swift in Sources */, + D1F76066230974DE000C5269 /* KingfisherError.swift in Sources */, + D1F76067230974DE000C5269 /* Deprecated.swift in Sources */, + D1F76068230974DE000C5269 /* WKInterfaceImage+Kingfisher.swift in Sources */, + D1F76069230974DE000C5269 /* Box.swift in Sources */, + D1F7606A230974DE000C5269 /* AuthenticationChallengeResponsable.swift in Sources */, + D1F7606B230974DE000C5269 /* KingfisherOptionsInfo.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ @@ -861,7 +1014,7 @@ CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_MODULES = NO; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; @@ -907,6 +1060,7 @@ ONLY_ACTIVE_ARCH = YES; PRODUCT_BUNDLE_PACKAGE_TYPE = BNDL; SUPPORTED_PLATFORMS = "watchsimulator iphonesimulator appletvsimulator watchos appletvos iphoneos macosx"; + SWIFT_INSTALL_OBJC_HEADER = NO; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = "1,2,3,4"; @@ -922,7 +1076,7 @@ CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_MODULES = NO; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; @@ -960,6 +1114,7 @@ MACOSX_DEPLOYMENT_TARGET = 10.12; PRODUCT_BUNDLE_PACKAGE_TYPE = BNDL; SUPPORTED_PLATFORMS = "watchsimulator iphonesimulator appletvsimulator watchos appletvos iphoneos macosx"; + SWIFT_INSTALL_OBJC_HEADER = NO; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = "1,2,3,4"; @@ -973,7 +1128,6 @@ buildSettings = { APPLICATION_EXTENSION_API_ONLY = YES; CLANG_ANALYZER_NONNULL = YES; - CLANG_ENABLE_MODULES = YES; CLANG_WARN_ASSIGN_ENUM = YES; CLANG_WARN_CXX0X_EXTENSIONS = YES; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; @@ -1012,9 +1166,9 @@ PRODUCT_BUNDLE_PACKAGE_TYPE = FMWK; PRODUCT_NAME = Kingfisher; SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; }; name = Debug; }; @@ -1023,7 +1177,6 @@ buildSettings = { APPLICATION_EXTENSION_API_ONLY = YES; CLANG_ANALYZER_NONNULL = YES; - CLANG_ENABLE_MODULES = YES; CLANG_WARN_ASSIGN_ENUM = YES; CLANG_WARN_CXX0X_EXTENSIONS = YES; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; @@ -1064,7 +1217,6 @@ SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; }; name = Release; }; @@ -1104,6 +1256,113 @@ }; name = Release; }; + D1F76070230974DE000C5269 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_WARN_ASSIGN_ENUM = YES; + CLANG_WARN_CXX0X_EXTENSIONS = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_IMPLICIT_SIGN_CONVERSION = YES; + CLANG_WARN_OBJC_EXPLICIT_OWNERSHIP_TYPE = YES; + CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS = YES; + CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES; + CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES; + CLANG_WARN_UNREACHABLE_CODE = YES_AGGRESSIVE; + CLANG_WARN__EXIT_TIME_DESTRUCTORS = YES; + CURRENT_PROJECT_VERSION = 1687; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1687; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES; + GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = YES; + GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; + GCC_WARN_ABOUT_MISSING_NEWLINE = YES; + GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; + GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES; + GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES; + GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; + GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; + GCC_WARN_SIGN_COMPARE = YES; + GCC_WARN_STRICT_SELECTOR_MATCH = YES; + GCC_WARN_UNKNOWN_PRAGMAS = YES; + GCC_WARN_UNUSED_LABEL = YES; + GCC_WARN_UNUSED_PARAMETER = YES; + INFOPLIST_FILE = Sources/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + LD_DYLIB_INSTALL_NAME = "$(DYLIB_INSTALL_NAME_BASE:standardizepath)/$(EXECUTABLE_PATH)"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.15; + OTHER_SWIFT_FLAGS = "-Xfrontend -warn-long-expression-type-checking=150"; + PRODUCT_BUNDLE_IDENTIFIER = com.onevcat.Kingfisher; + PRODUCT_BUNDLE_PACKAGE_TYPE = FMWK; + PRODUCT_NAME = Kingfisher; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + TVOS_DEPLOYMENT_TARGET = 13.0; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + WATCHOS_DEPLOYMENT_TARGET = 6.0; + }; + name = Debug; + }; + D1F76071230974DE000C5269 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_WARN_ASSIGN_ENUM = YES; + CLANG_WARN_CXX0X_EXTENSIONS = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_IMPLICIT_SIGN_CONVERSION = YES; + CLANG_WARN_OBJC_EXPLICIT_OWNERSHIP_TYPE = YES; + CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS = YES; + CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES; + CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES; + CLANG_WARN_UNREACHABLE_CODE = YES_AGGRESSIVE; + CLANG_WARN__EXIT_TIME_DESTRUCTORS = YES; + CURRENT_PROJECT_VERSION = 1687; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1687; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES; + GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = YES; + GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; + GCC_WARN_ABOUT_MISSING_NEWLINE = YES; + GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; + GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES; + GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES; + GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; + GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; + GCC_WARN_SIGN_COMPARE = YES; + GCC_WARN_STRICT_SELECTOR_MATCH = YES; + GCC_WARN_UNKNOWN_PRAGMAS = YES; + GCC_WARN_UNUSED_LABEL = YES; + GCC_WARN_UNUSED_PARAMETER = YES; + INFOPLIST_FILE = Sources/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + LD_DYLIB_INSTALL_NAME = "$(DYLIB_INSTALL_NAME_BASE:standardizepath)/$(EXECUTABLE_PATH)"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.15; + OTHER_SWIFT_FLAGS = ""; + PRODUCT_BUNDLE_IDENTIFIER = com.onevcat.Kingfisher; + PRODUCT_BUNDLE_PACKAGE_TYPE = FMWK; + PRODUCT_NAME = Kingfisher; + SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + TVOS_DEPLOYMENT_TARGET = 13.0; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + WATCHOS_DEPLOYMENT_TARGET = 6.0; + }; + name = Release; + }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -1134,6 +1393,15 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + D1F7606F230974DE000C5269 /* Build configuration list for PBXNativeTarget "KingfisherSwiftUI" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + D1F76070230974DE000C5269 /* Debug */, + D1F76071230974DE000C5269 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; /* End XCConfigurationList section */ }; rootObject = D1ED2D031AD2CFA600CFC3EB /* Project object */; diff --git a/Kingfisher.xcodeproj/xcshareddata/xcschemes/KingfisherSwiftUI.xcscheme b/Kingfisher.xcodeproj/xcshareddata/xcschemes/KingfisherSwiftUI.xcscheme index d79b7f2f5..928829823 100644 --- a/Kingfisher.xcodeproj/xcshareddata/xcschemes/KingfisherSwiftUI.xcscheme +++ b/Kingfisher.xcodeproj/xcshareddata/xcschemes/KingfisherSwiftUI.xcscheme @@ -1,7 +1,7 @@ + version = "1.3"> @@ -14,9 +14,9 @@ buildForAnalyzing = "YES"> @@ -27,8 +27,8 @@ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" shouldUseLaunchSchemeArgsEnv = "YES"> - - + + diff --git a/Package.swift b/Package.swift index bb998a82f..f4f753ac1 100644 --- a/Package.swift +++ b/Package.swift @@ -10,7 +10,8 @@ let package = Package( targets: [ .target( name: "Kingfisher", - path: "Sources" + path: "Sources", + exclude: ["SwiftUI"] ) ] ) diff --git a/Sources/Cache/Storage.swift b/Sources/Cache/Storage.swift index acd7f0652..bbc70900a 100644 --- a/Sources/Cache/Storage.swift +++ b/Sources/Cache/Storage.swift @@ -55,10 +55,15 @@ public enum StorageExpiration { func estimatedExpirationSince(_ date: Date) -> Date { switch self { case .never: return .distantFuture - case .seconds(let seconds): return date.addingTimeInterval(seconds) - case .days(let days): return date.addingTimeInterval(TimeInterval(TimeConstants.secondsInOneDay * days)) - case .date(let ref): return ref - case .expired: return .distantPast + case .seconds(let seconds): + return date.addingTimeInterval(seconds) + case .days(let days): + let duration = TimeInterval(TimeConstants.secondsInOneDay * days) + return date.addingTimeInterval(duration) + case .date(let ref): + return ref + case .expired: + return .distantPast } } diff --git a/Sources/SwiftUI/ImageBinder.swift b/Sources/SwiftUI/ImageBinder.swift index 1225b972d..98c1ca26d 100644 --- a/Sources/SwiftUI/ImageBinder.swift +++ b/Sources/SwiftUI/ImageBinder.swift @@ -26,9 +26,7 @@ import Combine import SwiftUI -import Kingfisher -@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *) extension KFImage { /// Represents a binder for `KFImage`. It takes responsibility as an `ObjectBinding` and performs @@ -46,7 +44,7 @@ extension KFImage { let onSuccessDelegate = Delegate() let onProgressDelegate = Delegate<(Int64, Int64), Void>() - @Published var image: Kingfisher.KFCrossPlatformImage? + @Published var image: KFCrossPlatformImage? // Only `.fade` is now supported. var fadeTransitionAnimation: Animation? { diff --git a/Sources/SwiftUI/Info.plist b/Sources/SwiftUI/Info.plist deleted file mode 100644 index e1fe4cfb7..000000000 --- a/Sources/SwiftUI/Info.plist +++ /dev/null @@ -1,22 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0 - CFBundleVersion - $(CURRENT_PROJECT_VERSION) - - diff --git a/Sources/SwiftUI/KFImage.swift b/Sources/SwiftUI/KFImage.swift index 39f6c7c23..6b2ffbacd 100644 --- a/Sources/SwiftUI/KFImage.swift +++ b/Sources/SwiftUI/KFImage.swift @@ -26,9 +26,7 @@ import SwiftUI import Combine -import Kingfisher -@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *) extension Image { // Creates an SwiftUI.Image with either UIImage or NSImage. init(crossPlatformImage: KFCrossPlatformImage) { @@ -42,7 +40,6 @@ extension Image { /// A Kingfisher compatible SwiftUI `View` to load an image from a `Source`. /// Declaring a `KFImage` in a `View`'s body to trigger loading from the given `Source`. -@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *) public struct KFImage: View { /// An image binder that manages loading and cancelling image related task. @@ -99,7 +96,6 @@ public struct KFImage: View { } } -@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *) extension KFImage { /// Configures current image with a `block`. This block will be lazily applied when creating the final `Image`. @@ -150,7 +146,6 @@ extension KFImage { } } -@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *) extension KFImage { /// Sets the action to perform when the image setting fails. @@ -182,7 +177,6 @@ extension KFImage { } #if DEBUG -@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *) struct KFImage_Previews : PreviewProvider { static var previews: some View { Group { diff --git a/Sources/SwiftUI/KingfisherSwiftUI.h b/Sources/SwiftUI/KingfisherSwiftUI.h deleted file mode 100644 index 380242ad5..000000000 --- a/Sources/SwiftUI/KingfisherSwiftUI.h +++ /dev/null @@ -1,37 +0,0 @@ -// -// KingfisherSwiftUI.h -// Kingfisher -// -// Created by onevcat on 2019/07/15. -// -// Copyright (c) 2019 Wei Wang -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import - -//! Project version number for KingfisherSwiftUI. -FOUNDATION_EXPORT double KingfisherSwiftUIVersionNumber; - -//! Project version string for KingfisherSwiftUI. -FOUNDATION_EXPORT const unsigned char KingfisherSwiftUIVersionString[]; - -// In this header, you should import all the public headers of your framework using statements like #import - - diff --git a/Sources/Views/Indicator.swift b/Sources/Views/Indicator.swift index 1e702af36..52bb0fc4c 100644 --- a/Sources/Views/Indicator.swift +++ b/Sources/Views/Indicator.swift @@ -120,12 +120,21 @@ final class ActivityIndicator: Indicator { activityIndicatorView.controlSize = .small activityIndicatorView.style = .spinning #else + let indicatorStyle: UIActivityIndicatorView.Style #if os(tvOS) - let indicatorStyle = UIActivityIndicatorView.Style.white + if #available(tvOS 13.0, *) { + indicatorStyle = UIActivityIndicatorView.Style.medium + } else { + indicatorStyle = UIActivityIndicatorView.Style.white + } #elseif targetEnvironment(macCatalyst) - let indicatorStyle = UIActivityIndicatorView.Style.medium + indicatorStyle = UIActivityIndicatorView.Style.medium #else - let indicatorStyle = UIActivityIndicatorView.Style.gray + if #available(iOS 13.0, *) { + indicatorStyle = UIActivityIndicatorView.Style.medium + } else { + indicatorStyle = UIActivityIndicatorView.Style.gray + } #endif #if swift(>=4.2) activityIndicatorView = UIActivityIndicatorView(style: indicatorStyle)