diff --git a/Demo/Demo/Kingfisher-Demo/Base.lproj/Main.storyboard b/Demo/Demo/Kingfisher-Demo/Base.lproj/Main.storyboard index b4c90a7c3..7d78b3ab4 100644 --- a/Demo/Demo/Kingfisher-Demo/Base.lproj/Main.storyboard +++ b/Demo/Demo/Kingfisher-Demo/Base.lproj/Main.storyboard @@ -1,9 +1,9 @@ - + - + @@ -395,6 +395,30 @@ + + + + + + + + + + + + + + + + + + + @@ -888,6 +912,16 @@ + + + + + + + + + + diff --git a/Demo/Demo/Kingfisher-SwiftUI-Demo/MainView.swift b/Demo/Demo/Kingfisher-Demo/SwiftUIViews/MainView.swift similarity index 67% rename from Demo/Demo/Kingfisher-SwiftUI-Demo/MainView.swift rename to Demo/Demo/Kingfisher-Demo/SwiftUIViews/MainView.swift index 711f96945..48b62ce7e 100644 --- a/Demo/Demo/Kingfisher-SwiftUI-Demo/MainView.swift +++ b/Demo/Demo/Kingfisher-Demo/SwiftUIViews/MainView.swift @@ -25,33 +25,30 @@ // THE SOFTWARE. import SwiftUI -import class Kingfisher.KingfisherManager +import Kingfisher +@available(iOS 13.0, *) struct MainView: View { var body: some View { - - NavigationView { - List { - Button( - action: { - KingfisherManager.shared.cache.clearMemoryCache() - KingfisherManager.shared.cache.clearDiskCache() - }, - label: { - Text("Clear Cache").foregroundColor(.blue) - } - ) - NavigationLink(destination: SwiftUIView()) { Text("Basic Image") } - NavigationLink(destination: SwiftUIList()) { Text("List") } - }.navigationBarTitle(Text("Kingfisher")) - } + List { + Button( + action: { + KingfisherManager.shared.cache.clearMemoryCache() + KingfisherManager.shared.cache.clearDiskCache() + }, + label: { + Text("Clear Cache").foregroundColor(.blue) + } + ) + NavigationLink(destination: SwiftUIView()) { Text("Basic Image") } + NavigationLink(destination: SwiftUIList()) { Text("List") } + }.navigationBarTitle(Text("SwiftUI Sample")) } } -#if DEBUG +@available(iOS 13.0, *) struct MainView_Previews: PreviewProvider { static var previews: some View { MainView() } } -#endif diff --git a/Demo/Demo/Kingfisher-SwiftUI-Demo/Views/SwiftUIList.swift b/Demo/Demo/Kingfisher-Demo/SwiftUIViews/SwiftUIList.swift similarity index 97% rename from Demo/Demo/Kingfisher-SwiftUI-Demo/Views/SwiftUIList.swift rename to Demo/Demo/Kingfisher-Demo/SwiftUIViews/SwiftUIList.swift index f3fbbb7c8..793fca7c0 100644 --- a/Demo/Demo/Kingfisher-SwiftUI-Demo/Views/SwiftUIList.swift +++ b/Demo/Demo/Kingfisher-Demo/SwiftUIViews/SwiftUIList.swift @@ -24,10 +24,10 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import class Kingfisher.ImageCache -import KingfisherSwiftUI +import Kingfisher import SwiftUI +@available(iOS 13.0, *) struct SwiftUIList : View { let index = 1 ..< 700 @@ -89,10 +89,9 @@ struct SwiftUIList : View { } } -#if DEBUG +@available(iOS 13.0, *) struct SwiftUIList_Previews : PreviewProvider { static var previews: some View { SwiftUIList() } } -#endif diff --git a/Demo/Demo/Kingfisher-SwiftUI-Demo/Views/SwiftUIView.swift b/Demo/Demo/Kingfisher-Demo/SwiftUIViews/SwiftUIView.swift similarity index 97% rename from Demo/Demo/Kingfisher-SwiftUI-Demo/Views/SwiftUIView.swift rename to Demo/Demo/Kingfisher-Demo/SwiftUIViews/SwiftUIView.swift index b1a5cfd88..9e072a1ad 100644 --- a/Demo/Demo/Kingfisher-SwiftUI-Demo/Views/SwiftUIView.swift +++ b/Demo/Demo/Kingfisher-Demo/SwiftUIViews/SwiftUIView.swift @@ -24,9 +24,10 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import KingfisherSwiftUI +import Kingfisher import SwiftUI +@available(iOS 13.0, *) struct SwiftUIView : View { @State private var index = 1 @@ -58,10 +59,9 @@ struct SwiftUIView : View { } } -#if DEBUG +@available(iOS 13.0, *) struct SwiftUIView_Previews : PreviewProvider { static var previews: some View { SwiftUIView() } } -#endif diff --git a/Sources/SwiftUI/Delegate.swift b/Demo/Demo/Kingfisher-Demo/ViewControllers/SwiftUIViewController.swift similarity index 55% rename from Sources/SwiftUI/Delegate.swift rename to Demo/Demo/Kingfisher-Demo/ViewControllers/SwiftUIViewController.swift index 15915c9e8..b080fc1e5 100644 --- a/Sources/SwiftUI/Delegate.swift +++ b/Demo/Demo/Kingfisher-Demo/ViewControllers/SwiftUIViewController.swift @@ -1,10 +1,10 @@ // -// Delegate.swift +// SwiftUIViewController.swift // Kingfisher // -// Created by onevcat on 2018/10/10. +// Created by onevcat on 2020/12/16. // -// Copyright (c) 2019 Wei Wang +// Copyright (c) 2020 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 @@ -24,30 +24,16 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import Foundation +import SwiftUI +import UIKit -/// A delegate helper type to "shadow" weak `self`, to prevent creating an unexpected retain cycle. -class Delegate { - init() {} - - private var block: ((Input) -> Output?)? - - func delegate(on target: T, block: ((T, Input) -> Output)?) { - // The `target` is weak inside block, so you do not need to worry about it in the caller side. - self.block = { [weak target] input in - guard let target = target else { return nil } - return block?(target, input) - } +@available(iOS 13.0, *) +class SwiftUIViewController: UIHostingController { + required init?(coder: NSCoder) { + super.init(coder: coder,rootView: MainView()); } - - func call(_ input: Input) -> Output? { - return block?(input) - } -} -extension Delegate where Input == Void { - // To make syntax better for `Void` input. - func call() -> Output? { - return call(()) + override func viewDidLoad() { + super.viewDidLoad() } } diff --git a/Demo/Demo/Kingfisher-SwiftUI-Demo/AppDelegate.swift b/Demo/Demo/Kingfisher-SwiftUI-Demo/AppDelegate.swift deleted file mode 100644 index fe1c41661..000000000 --- a/Demo/Demo/Kingfisher-SwiftUI-Demo/AppDelegate.swift +++ /dev/null @@ -1,55 +0,0 @@ -// -// AppDelegate.swift -// Kingfisher -// -// Created by onevcat on 2019/08/18. -// -// 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 UIKit - -@UIApplicationMain -class AppDelegate: UIResponder, UIApplicationDelegate { - - - - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { - // Override point for customization after application launch. - return true - } - - // MARK: UISceneSession Lifecycle - - func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { - // Called when a new scene session is being created. - // Use this method to select a configuration to create the new scene with. - return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) - } - - func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { - // Called when the user discards a scene session. - // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. - // Use this method to release any resources that were specific to the discarded scenes, as they will not return. - } - - -} - diff --git a/Demo/Demo/Kingfisher-SwiftUI-Demo/Assets.xcassets/AppIcon.appiconset/Contents.json b/Demo/Demo/Kingfisher-SwiftUI-Demo/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index d8db8d65f..000000000 --- a/Demo/Demo/Kingfisher-SwiftUI-Demo/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "images" : [ - { - "idiom" : "iphone", - "size" : "20x20", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "20x20", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "3x" - }, - { - "idiom" : "ipad", - "size" : "20x20", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "20x20", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "83.5x83.5", - "scale" : "2x" - }, - { - "idiom" : "ios-marketing", - "size" : "1024x1024", - "scale" : "1x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/Demo/Demo/Kingfisher-SwiftUI-Demo/Assets.xcassets/Contents.json b/Demo/Demo/Kingfisher-SwiftUI-Demo/Assets.xcassets/Contents.json deleted file mode 100644 index da4a164c9..000000000 --- a/Demo/Demo/Kingfisher-SwiftUI-Demo/Assets.xcassets/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/Demo/Demo/Kingfisher-SwiftUI-Demo/Base.lproj/LaunchScreen.storyboard b/Demo/Demo/Kingfisher-SwiftUI-Demo/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index 865e9329f..000000000 --- a/Demo/Demo/Kingfisher-SwiftUI-Demo/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Demo/Demo/Kingfisher-SwiftUI-Demo/Info.plist b/Demo/Demo/Kingfisher-SwiftUI-Demo/Info.plist deleted file mode 100644 index 9742bf0f4..000000000 --- a/Demo/Demo/Kingfisher-SwiftUI-Demo/Info.plist +++ /dev/null @@ -1,60 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - $(PRODUCT_BUNDLE_PACKAGE_TYPE) - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - LSRequiresIPhoneOS - - UIApplicationSceneManifest - - UIApplicationSupportsMultipleScenes - - UISceneConfigurations - - UIWindowSceneSessionRoleApplication - - - UISceneConfigurationName - Default Configuration - UISceneDelegateClassName - $(PRODUCT_MODULE_NAME).SceneDelegate - - - - - UILaunchStoryboardName - LaunchScreen - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - - diff --git a/Demo/Demo/Kingfisher-SwiftUI-Demo/Preview Content/Preview Assets.xcassets/Contents.json b/Demo/Demo/Kingfisher-SwiftUI-Demo/Preview Content/Preview Assets.xcassets/Contents.json deleted file mode 100644 index da4a164c9..000000000 --- a/Demo/Demo/Kingfisher-SwiftUI-Demo/Preview Content/Preview Assets.xcassets/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/Demo/Demo/Kingfisher-SwiftUI-Demo/SceneDelegate.swift b/Demo/Demo/Kingfisher-SwiftUI-Demo/SceneDelegate.swift deleted file mode 100644 index c13153260..000000000 --- a/Demo/Demo/Kingfisher-SwiftUI-Demo/SceneDelegate.swift +++ /dev/null @@ -1,79 +0,0 @@ -// -// SceneDelegate.swift -// Kingfisher -// -// Created by onevcat on 2019/08/18. -// -// 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 UIKit -import SwiftUI - -class SceneDelegate: UIResponder, UIWindowSceneDelegate { - - var window: UIWindow? - - - func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { - // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. - // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. - // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). - - // Use a UIHostingController as window root view controller - if let windowScene = scene as? UIWindowScene { - let window = UIWindow(windowScene: windowScene) - window.rootViewController = UIHostingController(rootView: MainView()) - self.window = window - window.makeKeyAndVisible() - } - } - - func sceneDidDisconnect(_ scene: UIScene) { - // Called as the scene is being released by the system. - // This occurs shortly after the scene enters the background, or when its session is discarded. - // Release any resources associated with this scene that can be re-created the next time the scene connects. - // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead). - } - - func sceneDidBecomeActive(_ scene: UIScene) { - // Called when the scene has moved from an inactive state to an active state. - // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. - } - - func sceneWillResignActive(_ scene: UIScene) { - // Called when the scene will move from an active state to an inactive state. - // This may occur due to temporary interruptions (ex. an incoming phone call). - } - - func sceneWillEnterForeground(_ scene: UIScene) { - // Called as the scene transitions from the background to the foreground. - // Use this method to undo the changes made on entering the background. - } - - func sceneDidEnterBackground(_ scene: UIScene) { - // Called as the scene transitions from the foreground to the background. - // Use this method to save data, release shared resources, and store enough scene-specific state information - // to restore the scene back to its current state. - } - - -} - diff --git a/Demo/Kingfisher-Demo.xcodeproj/project.pbxproj b/Demo/Kingfisher-Demo.xcodeproj/project.pbxproj index 491ad313e..21180ff69 100644 --- a/Demo/Kingfisher-Demo.xcodeproj/project.pbxproj +++ b/Demo/Kingfisher-Demo.xcodeproj/project.pbxproj @@ -27,10 +27,6 @@ 4BE855562320F9CF00FE4205 /* Kingfisher.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 4BE855542320F9CF00FE4205 /* Kingfisher.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 4BE855582320F9D300FE4205 /* Kingfisher.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4BE855572320F9D300FE4205 /* Kingfisher.framework */; }; 4BE855592320F9D300FE4205 /* Kingfisher.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 4BE855572320F9D300FE4205 /* Kingfisher.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 4BE8555C2320F9D800FE4205 /* Kingfisher.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4BE8555A2320F9D800FE4205 /* Kingfisher.framework */; }; - 4BE8555D2320F9D800FE4205 /* Kingfisher.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 4BE8555A2320F9D800FE4205 /* Kingfisher.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 4BE8555E2320F9D800FE4205 /* KingfisherSwiftUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4BE8555B2320F9D800FE4205 /* KingfisherSwiftUI.framework */; }; - 4BE8555F2320F9D800FE4205 /* KingfisherSwiftUI.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 4BE8555B2320F9D800FE4205 /* KingfisherSwiftUI.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 4BE855612320F9DE00FE4205 /* Kingfisher.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4BE855602320F9DE00FE4205 /* Kingfisher.framework */; }; 4BE855622320F9DE00FE4205 /* Kingfisher.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 4BE855602320F9DE00FE4205 /* Kingfisher.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; C959EEE622874DC600467A10 /* ProgressiveJPEGViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C959EEE522874DC600467A10 /* ProgressiveJPEGViewController.swift */; }; @@ -59,14 +55,10 @@ 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 */; }; + D1F78A5F2589F0AA00930759 /* SwiftUIViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1F78A5E2589F0AA00930759 /* SwiftUIViewController.swift */; }; + D1F78A642589F17200930759 /* SwiftUIList.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1F78A612589F17200930759 /* SwiftUIList.swift */; }; + D1F78A652589F17200930759 /* MainView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1F78A622589F17200930759 /* MainView.swift */; }; + D1F78A662589F17200930759 /* SwiftUIView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1F78A632589F17200930759 /* SwiftUIView.swift */; }; D1FAB06F21A853E600908910 /* HighResolutionCollectionViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1FAB06E21A853E600908910 /* HighResolutionCollectionViewController.swift */; }; /* End PBXBuildFile section */ @@ -81,18 +73,6 @@ /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ - D10402B6230996BE00B3D4CB /* Embed Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - 4BE8555F2320F9D800FE4205 /* KingfisherSwiftUI.framework in Embed Frameworks */, - 4BE8555D2320F9D800FE4205 /* Kingfisher.framework in Embed Frameworks */, - ); - name = "Embed Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; D12F2EEC1C4E7CF500B8054D /* Embed Frameworks */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; @@ -211,16 +191,10 @@ 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 = ""; }; + D1F78A5E2589F0AA00930759 /* SwiftUIViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftUIViewController.swift; sourceTree = ""; }; + D1F78A612589F17200930759 /* SwiftUIList.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwiftUIList.swift; sourceTree = ""; }; + D1F78A622589F17200930759 /* MainView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MainView.swift; sourceTree = ""; }; + D1F78A632589F17200930759 /* SwiftUIView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwiftUIView.swift; sourceTree = ""; }; D1FAB06E21A853E600908910 /* HighResolutionCollectionViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HighResolutionCollectionViewController.swift; sourceTree = ""; }; /* End PBXFileReference section */ @@ -264,15 +238,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - D1F7609223098F62000C5269 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 4BE8555E2320F9D800FE4205 /* KingfisherSwiftUI.framework in Frameworks */, - 4BE8555C2320F9D800FE4205 /* Kingfisher.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ @@ -329,7 +294,6 @@ D10EC22B1C3D62DE00A4211C /* Demo */ = { isa = PBXGroup; children = ( - D1F760A923098FA2000C5269 /* Kingfisher-SwiftUI-Demo */, D12E0C8B1C47F91800AC98AD /* Kingfisher-Demo */, 4BCCF3351D5B02F8003387C2 /* Kingfisher-macOS-Demo */, D12E0C9C1C47F92200AC98AD /* Kingfisher-tvOS-Demo */, @@ -347,6 +311,7 @@ D12EB83F24DDB9E000329EE1 /* LaunchScreen.storyboard */, D12E0C8F1C47F91800AC98AD /* Main.storyboard */, D1A1CCA921A1936300263AD8 /* ViewControllers */, + D1F78A602589F14C00930759 /* SwiftUIViews */, D1A1CCA521A1895000263AD8 /* Extensions */, D1A1CCAB21A1939100263AD8 /* Resources */, D12E0C921C47F91800AC98AD /* Images.xcassets */, @@ -392,6 +357,7 @@ C959EEE522874DC600467A10 /* ProgressiveJPEGViewController.swift */, D12EB83D24DD902300329EE1 /* TextAttachmentViewController.swift */, D16CC3D724E03FEA00F1A515 /* AVAssetImageGeneratorViewController.swift */, + D1F78A5E2589F0AA00930759 /* SwiftUIViewController.swift */, ); path = ViewControllers; sourceTree = ""; @@ -423,42 +389,18 @@ 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 */ = { + D1F78A602589F14C00930759 /* SwiftUIViews */ = { isa = PBXGroup; children = ( - D1F760B223098FA2000C5269 /* SwiftUIList.swift */, - D1F760B323098FA2000C5269 /* SwiftUIView.swift */, + D1F78A622589F17200930759 /* MainView.swift */, + D1F78A612589F17200930759 /* SwiftUIList.swift */, + D1F78A632589F17200930759 /* SwiftUIView.swift */, ); - path = Views; + path = SwiftUIViews; sourceTree = ""; }; /* End PBXGroup section */ @@ -555,24 +497,6 @@ 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 */ @@ -608,11 +532,6 @@ DevelopmentTeam = A4YJ9MRZ66; LastSwiftMigration = 1200; }; - D1F7609423098F62000C5269 = { - CreatedOnToolsVersion = 11.0; - DevelopmentTeam = A4YJ9MRZ66; - ProvisioningStyle = Automatic; - }; }; }; buildConfigurationList = D1ED2D061AD2CFA600CFC3EB /* Build configuration list for PBXProject "Kingfisher-Demo" */; @@ -631,7 +550,6 @@ D1ED2D0A1AD2CFA600CFC3EB /* Kingfisher-Demo */, D13F49C11BEDA53F00CE335D /* Kingfisher-tvOS-Demo */, 4B2944541C3D03880088C3E7 /* Kingfisher-macOS-Demo */, - D1F7609423098F62000C5269 /* Kingfisher-SwiftUI-Demo */, D1679A381C4E78B20020FD12 /* Kingfisher-watchOS-Demo */, D1679A441C4E78B20020FD12 /* Kingfisher-watchOS-Demo Extension */, ); @@ -688,16 +606,6 @@ ); 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 */ @@ -743,10 +651,14 @@ D1CE1BD021A1AFA300419000 /* TransitionViewController.swift in Sources */, D10AC99821A300C9005F057C /* ProcessorCollectionViewController.swift in Sources */, D1F06F3921AAF1EE000B1C38 /* IndicatorCollectionViewController.swift in Sources */, + D1F78A662589F17200930759 /* SwiftUIView.swift in Sources */, D12E0C981C47F91800AC98AD /* ImageCollectionViewCell.swift in Sources */, D1A1CCA721A18A3200263AD8 /* UIViewController+KingfisherOperation.swift in Sources */, + D1F78A642589F17200930759 /* SwiftUIList.swift in Sources */, D1E4CF5421BACBA6004D029D /* ImageDataProviderCollectionViewController.swift in Sources */, D1FAB06F21A853E600908910 /* HighResolutionCollectionViewController.swift in Sources */, + D1F78A652589F17200930759 /* MainView.swift in Sources */, + D1F78A5F2589F0AA00930759 /* SwiftUIViewController.swift in Sources */, D12E0C951C47F91800AC98AD /* AppDelegate.swift in Sources */, D1F06F3321AA4292000B1C38 /* DetailImageViewController.swift in Sources */, 4B1C7A3D21A256E300CE9D31 /* InfinityCollectionViewController.swift in Sources */, @@ -755,18 +667,6 @@ ); 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 */ @@ -810,14 +710,6 @@ name = Main.storyboard; sourceTree = ""; }; - D1F760AD23098FA2000C5269 /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - D1F760AE23098FA2000C5269 /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ @@ -1133,60 +1025,6 @@ }; 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; - 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)"; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Release; - }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -1244,15 +1082,6 @@ 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.podspec b/Kingfisher.podspec index 2c9fda7b2..d62a8f0dd 100644 --- a/Kingfisher.podspec +++ b/Kingfisher.podspec @@ -25,7 +25,7 @@ Pod::Spec.new do |s| s.authors = { "onevcat" => "onevcat@gmail.com" } s.social_media_url = "https://twitter.com/onevcat" - s.swift_version = "4.2" + s.swift_version = "5.0" s.swift_versions = ['4.0', '4.2', '5.0'] s.ios.deployment_target = "10.0" @@ -34,26 +34,8 @@ Pod::Spec.new do |s| s.watchos.deployment_target = "3.0" s.source = { :git => "https://github.com/onevcat/Kingfisher.git", :tag => s.version } - - s.default_subspecs = "Core" + s.source_files = ["Sources/**/*.swift", "Sources/Kingfisher.h"] s.requires_arc = true s.frameworks = "CFNetwork", "Accelerate" - - s.subspec "Core" do |sp| - sp.source_files = ["Sources/**/*.swift", "Sources/Kingfisher.h"] - sp.exclude_files = ["Sources/SwiftUI/**"] - end - - s.subspec "SwiftUI" do |sp| - sp.source_files = ["Sources/SwiftUI/**"] - sp.exclude_files = ["Sources/SwiftUI/Delegate.swift"] - sp.dependency "Kingfisher/Core" - sp.ios.deployment_target = "10.0" - sp.tvos.deployment_target = "10.0" - sp.osx.deployment_target = "10.12" - sp.watchos.deployment_target = "3.0" - sp.pod_target_xcconfig = { 'OTHER_SWIFT_FLAGS' => '-DKingfisherCocoaPods' } - end - end diff --git a/Kingfisher.xcodeproj/project.pbxproj b/Kingfisher.xcodeproj/project.pbxproj index 688212eab..3c28f8f13 100644 --- a/Kingfisher.xcodeproj/project.pbxproj +++ b/Kingfisher.xcodeproj/project.pbxproj @@ -8,7 +8,6 @@ /* Begin PBXBuildFile section */ 4B10480D216F157000300C61 /* ImageDataProcessor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B10480C216F157000300C61 /* ImageDataProcessor.swift */; }; - 4B24D1762314CDDA00497D39 /* Delegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B24D1752314CDDA00497D39 /* Delegate.swift */; }; 4B46CC5F217449C600D90C4A /* MemoryStorage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B46CC5E217449C600D90C4A /* MemoryStorage.swift */; }; 4B46CC64217449E000D90C4A /* Storage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B46CC63217449E000D90C4A /* Storage.swift */; }; 4B46CC6921744AC500D90C4A /* DiskStorage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B46CC6821744AC500D90C4A /* DiskStorage.swift */; }; @@ -93,13 +92,14 @@ D1839845216E333E003927D3 /* Delegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1839844216E333E003927D3 /* Delegate.swift */; }; D186696D21834261002B502E /* ImageDrawingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D186696C21834261002B502E /* ImageDrawingTests.swift */; }; D18B3222251852E100662F63 /* KF.swift in Sources */ = {isa = PBXBuildFile; fileRef = D18B3221251852E100662F63 /* KF.swift */; }; - D19ADD0C23099E3B00D20B28 /* Kingfisher.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D1ED2D351AD2D09F00CFC3EB /* Kingfisher.framework */; }; D1A1CC9A219FAB4B00263AD8 /* Source.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1A1CC99219FAB4B00263AD8 /* Source.swift */; }; D1A1CC9F21A0F98600263AD8 /* ImageDataProviderTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1A1CC9E21A0F98600263AD8 /* ImageDataProviderTests.swift */; }; D1A37BDE215D34E8009B39B7 /* ImageDrawing.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1A37BDD215D34E8009B39B7 /* ImageDrawing.swift */; }; D1A37BE3215D359F009B39B7 /* ImageFormat.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1A37BE2215D359F009B39B7 /* ImageFormat.swift */; }; D1A37BE8215D365A009B39B7 /* ExtensionHelpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1A37BE7215D365A009B39B7 /* ExtensionHelpers.swift */; }; D1A37BF2215D3850009B39B7 /* SizeExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1A37BF1215D3850009B39B7 /* SizeExtensions.swift */; }; + D1AEB09425890DE7008556DF /* ImageBinder.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1F7607523097532000C5269 /* ImageBinder.swift */; }; + D1AEB09725890DEA008556DF /* KFImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1F7607623097532000C5269 /* KFImage.swift */; }; D1BA781D2174D07800C69D7B /* CallbackQueue.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1BA781C2174D07800C69D7B /* CallbackQueue.swift */; }; D1BFED95222ACC6B009330C8 /* ImageProcessorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1BFED94222ACC6B009330C8 /* ImageProcessorTests.swift */; }; D1D2C32A1C70A3230018F2F9 /* single-frame.gif in Resources */ = {isa = PBXBuildFile; fileRef = D1D2C3291C70A3230018F2F9 /* single-frame.gif */; }; @@ -108,9 +108,6 @@ D1E56445219B16330057AAE3 /* ImageDataProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1E56444219B16330057AAE3 /* ImageDataProvider.swift */; }; D1ED2D401AD2D09F00CFC3EB /* Kingfisher.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D1ED2D351AD2D09F00CFC3EB /* Kingfisher.framework */; }; D1F1F6FF24625EC600910725 /* RetryStrategyTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1F1F6FE24625EC600910725 /* RetryStrategyTests.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 */; }; DCEB2842257E4BE100D7A610 /* TVMonogramView+Kingfisher.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCEB2841257E4BE100D7A610 /* TVMonogramView+Kingfisher.swift */; }; @@ -131,7 +128,6 @@ 185218B51CC07F8300BD58DE /* NSButtonExtensionTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NSButtonExtensionTests.swift; sourceTree = ""; }; 4B10480C216F157000300C61 /* ImageDataProcessor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImageDataProcessor.swift; sourceTree = ""; }; 4B164ACE1B8D554200768EC6 /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = System/Library/Frameworks/CFNetwork.framework; sourceTree = SDKROOT; }; - 4B24D1752314CDDA00497D39 /* Delegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Delegate.swift; sourceTree = ""; }; 4B3E714D1B01FEB200F5AAED /* WatchKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WatchKit.framework; path = System/Library/Frameworks/WatchKit.framework; sourceTree = SDKROOT; }; 4B46CC5E217449C600D90C4A /* MemoryStorage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MemoryStorage.swift; sourceTree = ""; }; 4B46CC63217449E000D90C4A /* Storage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Storage.swift; sourceTree = ""; }; @@ -265,7 +261,6 @@ 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; }; D1F1F6FE24625EC600910725 /* RetryStrategyTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RetryStrategyTests.swift; sourceTree = ""; }; - D1F76072230974DE000C5269 /* KingfisherSwiftUI.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = KingfisherSwiftUI.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 = ""; }; @@ -290,14 +285,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - D1F7606C230974DE000C5269 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - D19ADD0C23099E3B00D20B28 /* Kingfisher.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ @@ -652,7 +639,6 @@ children = ( D1ED2D351AD2D09F00CFC3EB /* Kingfisher.framework */, D1ED2D3F1AD2D09F00CFC3EB /* KingfisherTests.xctest */, - D1F76072230974DE000C5269 /* KingfisherSwiftUI.framework */, ); name = Products; sourceTree = ""; @@ -660,7 +646,6 @@ D1F7607423097532000C5269 /* SwiftUI */ = { isa = PBXGroup; children = ( - 4B24D1752314CDDA00497D39 /* Delegate.swift */, D1F7607523097532000C5269 /* ImageBinder.swift */, D1F7607623097532000C5269 /* KFImage.swift */, ); @@ -688,14 +673,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - D1F7606D230974DE000C5269 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - D1F7606E230974DE000C5269 /* Kingfisher.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ @@ -734,23 +711,6 @@ 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 /* KingfisherSwiftUI.framework */; - productType = "com.apple.product-type.framework"; - }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ @@ -786,7 +746,6 @@ projectRoot = ""; targets = ( D1ED2D341AD2D09F00CFC3EB /* Kingfisher */, - D1F7603B230974DE000C5269 /* KingfisherSwiftUI */, D1ED2D3E1AD2D09F00CFC3EB /* KingfisherTests */, ); }; @@ -826,10 +785,12 @@ C9286407228584EB00257182 /* ImageProgressive.swift in Sources */, D12AB6DC215D2BB50013BA68 /* ImageProcessor.swift in Sources */, D12AB6D4215D2BB50013BA68 /* Image.swift in Sources */, + D1AEB09425890DE7008556DF /* ImageBinder.swift in Sources */, D12AB728215D2BB50013BA68 /* String+MD5.swift in Sources */, 4B8E2917216F3F7F0095FAD1 /* ImageDownloaderDelegate.swift in Sources */, D18B3222251852E100662F63 /* KF.swift in Sources */, D12AB704215D2BB50013BA68 /* Kingfisher.swift in Sources */, + D1AEB09725890DEA008556DF /* KFImage.swift in Sources */, D1BA781D2174D07800C69D7B /* CallbackQueue.swift in Sources */, D12AB71C215D2BB50013BA68 /* FormatIndicatedCacheSerializer.swift in Sources */, D1A37BF2215D3850009B39B7 /* SizeExtensions.swift in Sources */, @@ -918,16 +879,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - D1F7603C230974DE000C5269 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 4B24D1762314CDDA00497D39 /* Delegate.swift in Sources */, - D1F7607823097533000C5269 /* KFImage.swift in Sources */, - D1F7607723097533000C5269 /* ImageBinder.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ @@ -1190,115 +1141,6 @@ }; 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 = 2074; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 2074; - 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 = 10.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.KingfisherSwiftUI; - PRODUCT_BUNDLE_PACKAGE_TYPE = FMWK; - PRODUCT_NAME = KingfisherSwiftUI; - SKIP_INSTALL = YES; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_INSTALL_OBJC_HEADER = YES; - 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 = 2074; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 2074; - 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 = 10.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.KingfisherSwiftUI; - PRODUCT_BUNDLE_PACKAGE_TYPE = FMWK; - PRODUCT_NAME = KingfisherSwiftUI; - SKIP_INSTALL = YES; - SWIFT_INSTALL_OBJC_HEADER = 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 */ @@ -1329,15 +1171,6 @@ 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/Sources/SwiftUI/ImageBinder.swift b/Sources/SwiftUI/ImageBinder.swift index 229dd848a..2425e217a 100644 --- a/Sources/SwiftUI/ImageBinder.swift +++ b/Sources/SwiftUI/ImageBinder.swift @@ -27,9 +27,6 @@ #if canImport(SwiftUI) && canImport(Combine) import Combine import SwiftUI -#if !KingfisherCocoaPods -import Kingfisher -#endif @available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *) extension KFImage { diff --git a/Sources/SwiftUI/KFImage.swift b/Sources/SwiftUI/KFImage.swift index abb512d01..09b910186 100644 --- a/Sources/SwiftUI/KFImage.swift +++ b/Sources/SwiftUI/KFImage.swift @@ -27,9 +27,6 @@ #if canImport(SwiftUI) && canImport(Combine) import Combine import SwiftUI -#if !KingfisherCocoaPods -import Kingfisher -#endif @available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *) extension SwiftUI.Image {