Iggy Drougge 3 лет назад
Родитель
Сommit
03d48c13a8

+ 0 - 6
Sources/Cache/ImageCache.swift

@@ -846,12 +846,6 @@ open class ImageCache {
     }
     }
 }
 }
 
 
-extension Dictionary {
-    func keysSortedByValue(_ isOrderedBefore: (Value, Value) -> Bool) -> [Key] {
-        return Array(self).sorted{ isOrderedBefore($0.1, $1.1) }.map{ $0.0 }
-    }
-}
-
 #if !os(macOS) && !os(watchOS)
 #if !os(macOS) && !os(watchOS)
 // MARK: - For App Extensions
 // MARK: - For App Extensions
 extension UIApplication: KingfisherCompatible { }
 extension UIApplication: KingfisherCompatible { }

+ 0 - 3
Sources/Cache/Storage.swift

@@ -28,9 +28,6 @@ import Foundation
 
 
 /// Constants for some time intervals
 /// Constants for some time intervals
 struct TimeConstants {
 struct TimeConstants {
-    static let secondsInOneMinute = 60
-    static let minutesInOneHour = 60
-    static let hoursInOneDay = 24
     static let secondsInOneDay = 86_400
     static let secondsInOneDay = 86_400
 }
 }
 
 

+ 0 - 7
Sources/General/ImageSource/Source.swift

@@ -113,11 +113,4 @@ extension Source {
         }
         }
         return resource
         return resource
     }
     }
-
-    var asProvider: ImageDataProvider? {
-        guard case .provider(let provider) = self else {
-            return nil
-        }
-        return provider
-    }
 }
 }

+ 0 - 15
Sources/Image/ImageProcessor.swift

@@ -917,19 +917,4 @@ extension KFCrossPlatformColor {
         let components = self.rgba
         let components = self.rgba
         return String(format: "(%.2f,%.2f,%.2f,%.2f)", components.r, components.g, components.b, components.a)
         return String(format: "(%.2f,%.2f,%.2f,%.2f)", components.r, components.g, components.b, components.a)
     }
     }
-    
-    @available(*, deprecated, message: "`hex` is not safe for colors in extended space. Do not use this.")
-    var hex: String {
-        
-        let (r, g, b, a) = rgba
-
-        let rInt = Int(r * 255) << 24
-        let gInt = Int(g * 255) << 16
-        let bInt = Int(b * 255) << 8
-        let aInt = Int(a * 255)
-        
-        let rgba = rInt | gInt | bInt | aInt
-        
-        return String(format:"#%08x", rgba)
-    }
 }
 }

+ 0 - 9
Sources/Image/ImageProgressive.swift

@@ -58,10 +58,6 @@ public struct ImageProgressive {
     }
     }
 }
 }
 
 
-protocol ImageSettable: AnyObject {
-    var image: KFCrossPlatformImage? { get set }
-}
-
 final class ImageProgressiveProvider: DataReceivingSideEffect {
 final class ImageProgressiveProvider: DataReceivingSideEffect {
     
     
     var onShouldApply: () -> Bool = { return true }
     var onShouldApply: () -> Bool = { return true }
@@ -269,7 +265,6 @@ private final class ImageProgressiveSerialQueue {
     private var items: [DispatchWorkItem] = []
     private var items: [DispatchWorkItem] = []
     private var notify: (() -> Void)?
     private var notify: (() -> Void)?
     private var lastTime: TimeInterval?
     private var lastTime: TimeInterval?
-    var count: Int { return items.count }
 
 
     init() {
     init() {
         self.queue = DispatchQueue(label: "com.onevcat.Kingfisher.ImageProgressive.SerialQueue")
         self.queue = DispatchQueue(label: "com.onevcat.Kingfisher.ImageProgressive.SerialQueue")
@@ -314,10 +309,6 @@ private final class ImageProgressiveSerialQueue {
         }
         }
     }
     }
     
     
-    func notify(_ closure: @escaping () -> Void) {
-        self.notify = closure
-    }
-    
     func clean() {
     func clean() {
         queue.async { [weak self] in
         queue.async { [weak self] in
             guard let self = self else { return }
             guard let self = self else { return }

+ 0 - 8
Sources/Utility/ExtensionHelpers.swift

@@ -104,18 +104,10 @@ extension Date {
         return isPast(referenceDate: Date())
         return isPast(referenceDate: Date())
     }
     }
 
 
-    var isFuture: Bool {
-        return !isPast
-    }
-
     func isPast(referenceDate: Date) -> Bool {
     func isPast(referenceDate: Date) -> Bool {
         return timeIntervalSince(referenceDate) <= 0
         return timeIntervalSince(referenceDate) <= 0
     }
     }
 
 
-    func isFuture(referenceDate: Date) -> Bool {
-        return !isPast(referenceDate: referenceDate)
-    }
-
     // `Date` in memory is a wrap for `TimeInterval`. But in file attribute it can only accept `Int` number.
     // `Date` in memory is a wrap for `TimeInterval`. But in file attribute it can only accept `Int` number.
     // By default the system will `round` it. But it is not friendly for testing purpose.
     // By default the system will `round` it. But it is not friendly for testing purpose.
     // So we always `ceil` the value when used for file attributes.
     // So we always `ceil` the value when used for file attributes.

+ 0 - 21
Sources/Utility/Result.swift

@@ -47,25 +47,4 @@ extension Result where Failure: Error {
             return onFailure(error)
             return onFailure(error)
         }
         }
     }
     }
-
-    func matchSuccess<Output>(with folder: (Success?) -> Output) -> Output {
-        return match(
-            onSuccess: { value in return folder(value) },
-            onFailure: { _ in return folder(nil) }
-        )
-    }
-
-    func matchFailure<Output>(with folder: (Error?) -> Output) -> Output {
-        return match(
-            onSuccess: { _ in return folder(nil) },
-            onFailure: { error in return folder(error) }
-        )
-    }
-
-    func match<Output>(with folder: (Success?, Error?) -> Output) -> Output {
-        return match(
-            onSuccess: { return folder($0, nil) },
-            onFailure: { return folder(nil, $0) }
-        )
-    }
 }
 }

+ 0 - 10
Sources/Utility/String+MD5.swift

@@ -90,15 +90,6 @@ extension Int {
 
 
 }
 }
 
 
-extension NSMutableData {
-
-    // Convenient way to append bytes
-    func appendBytes(_ arrayOfBytes: [UInt8]) {
-        append(arrayOfBytes, length: arrayOfBytes.count)
-    }
-
-}
-
 protocol HashProtocol {
 protocol HashProtocol {
     var message: [UInt8] { get }
     var message: [UInt8] { get }
     // Common part for hash calculation. Prepare header data.
     // Common part for hash calculation. Prepare header data.
@@ -178,7 +169,6 @@ func rotateLeft(_ value: UInt32, bits: UInt32) -> UInt32 {
 
 
 class MD5: HashProtocol {
 class MD5: HashProtocol {
 
 
-    static let size = 16 // 128 / 8
     let message: [UInt8]
     let message: [UInt8]
 
 
     init (_ message: [UInt8]) {
     init (_ message: [UInt8]) {