onevcat 10 лет назад
Родитель
Сommit
4ac086a204

+ 0 - 6
Kingfisher.xcodeproj/project.pbxproj

@@ -33,7 +33,6 @@
 		D13F49F41BEDA8B300CE335D /* ImageCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1ED2D571AD2D0F900CFC3EB /* ImageCache.swift */; };
 		D13F49F51BEDA8B300CE335D /* ImageDownloader.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1ED2D581AD2D0F900CFC3EB /* ImageDownloader.swift */; };
 		D13F49F61BEDA8B300CE335D /* KingfisherManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1ED2D591AD2D0F900CFC3EB /* KingfisherManager.swift */; };
-		D13F49F71BEDA8B300CE335D /* KingfisherOptions.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1ED2D5A1AD2D0F900CFC3EB /* KingfisherOptions.swift */; };
 		D13F49F81BEDA8B300CE335D /* ImageTransition.swift in Sources */ = {isa = PBXBuildFile; fileRef = D11250C01BAC4B6300B986EF /* ImageTransition.swift */; };
 		D13F49F91BEDA8B300CE335D /* KingfisherOptionsInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B412CA41AE8A2F9008D530A /* KingfisherOptionsInfo.swift */; };
 		D13F49FA1BEDA8B300CE335D /* Resource.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B2C4DF71B7D7ACD000912CA /* Resource.swift */; };
@@ -58,7 +57,6 @@
 		D1ED2D5D1AD2D0F900CFC3EB /* ImageCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1ED2D571AD2D0F900CFC3EB /* ImageCache.swift */; };
 		D1ED2D5E1AD2D0F900CFC3EB /* ImageDownloader.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1ED2D581AD2D0F900CFC3EB /* ImageDownloader.swift */; };
 		D1ED2D5F1AD2D0F900CFC3EB /* KingfisherManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1ED2D591AD2D0F900CFC3EB /* KingfisherManager.swift */; };
-		D1ED2D601AD2D0F900CFC3EB /* KingfisherOptions.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1ED2D5A1AD2D0F900CFC3EB /* KingfisherOptions.swift */; };
 /* End PBXBuildFile section */
 
 /* Begin PBXContainerItemProxy section */
@@ -173,7 +171,6 @@
 		D1ED2D571AD2D0F900CFC3EB /* ImageCache.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImageCache.swift; sourceTree = "<group>"; };
 		D1ED2D581AD2D0F900CFC3EB /* ImageDownloader.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImageDownloader.swift; sourceTree = "<group>"; };
 		D1ED2D591AD2D0F900CFC3EB /* KingfisherManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KingfisherManager.swift; sourceTree = "<group>"; };
-		D1ED2D5A1AD2D0F900CFC3EB /* KingfisherOptions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KingfisherOptions.swift; sourceTree = "<group>"; };
 		D809C0611AAB7CA1AE240862 /* Pods-KingfisherTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-KingfisherTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-KingfisherTests/Pods-KingfisherTests.debug.xcconfig"; sourceTree = "<group>"; };
 /* End PBXFileReference section */
 
@@ -309,7 +306,6 @@
 				D1ED2D571AD2D0F900CFC3EB /* ImageCache.swift */,
 				D1ED2D581AD2D0F900CFC3EB /* ImageDownloader.swift */,
 				D1ED2D591AD2D0F900CFC3EB /* KingfisherManager.swift */,
-				D1ED2D5A1AD2D0F900CFC3EB /* KingfisherOptions.swift */,
 				D11250C01BAC4B6300B986EF /* ImageTransition.swift */,
 				4B412CA41AE8A2F9008D530A /* KingfisherOptionsInfo.swift */,
 				4B2C4DF71B7D7ACD000912CA /* Resource.swift */,
@@ -643,7 +639,6 @@
 				D13F49F41BEDA8B300CE335D /* ImageCache.swift in Sources */,
 				D13F49F51BEDA8B300CE335D /* ImageDownloader.swift in Sources */,
 				D13F49F61BEDA8B300CE335D /* KingfisherManager.swift in Sources */,
-				D13F49F71BEDA8B300CE335D /* KingfisherOptions.swift in Sources */,
 				D13F49F81BEDA8B300CE335D /* ImageTransition.swift in Sources */,
 				D13F49F91BEDA8B300CE335D /* KingfisherOptionsInfo.swift in Sources */,
 				D13F49FA1BEDA8B300CE335D /* Resource.swift in Sources */,
@@ -674,7 +669,6 @@
 				D1B1B9901BC7EB7100DE20D8 /* ThreadHelper.swift in Sources */,
 				4B412CA51AE8A2F9008D530A /* KingfisherOptionsInfo.swift in Sources */,
 				4B2C4DF81B7D7ACD000912CA /* Resource.swift in Sources */,
-				D1ED2D601AD2D0F900CFC3EB /* KingfisherOptions.swift in Sources */,
 				D11250C11BAC4B6300B986EF /* ImageTransition.swift in Sources */,
 				D151E72B1AD3C48D004FD4AE /* UIImage+Extension.swift in Sources */,
 			);

+ 0 - 12
Kingfisher/KingfisherManager.swift

@@ -220,15 +220,3 @@ public class KingfisherManager {
         retrieveImageTask.diskRetrieveTask = diskTask
     }
 }
-
-// MARK: - Deprecated
-public extension KingfisherManager {
-    @available(*, deprecated=1.2, message="Use -retrieveImageWithURL:optionsInfo:progressBlock:completionHandler: instead.")
-    public func retrieveImageWithURL(URL: NSURL,
-                                 options: KingfisherOptions,
-                           progressBlock: DownloadProgressBlock?,
-                       completionHandler: CompletionHandler?) -> RetrieveImageTask
-    {
-        return retrieveImageWithURL(URL, optionsInfo: [.Options(options)], progressBlock: progressBlock, completionHandler: completionHandler)
-    }
-}

+ 0 - 62
Kingfisher/KingfisherOptions.swift

@@ -1,62 +0,0 @@
-//
-//  KingfisherOptions.swift
-//  Kingfisher
-//
-//  Created by Wei Wang on 15/4/6.
-//
-//  Copyright (c) 2015 Wei Wang <onevcat@gmail.com>
-//
-//  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 Foundation
-
-/**
-*  Options to control Kingfisher behaviors.
-*/
-public struct KingfisherOptions: OptionSetType {
-
-    public let rawValue: UInt
-    
-    public init(rawValue: UInt) {
-        self.rawValue = rawValue
-    }
-    
-    /// None options. Kingfisher will keep its default behavior.
-    public static let None = KingfisherOptions(rawValue: 0)
-    
-    /// Try to send request to server first. If response code is 304 (Not Modified), use the cached image. Otherwise, download the image and cache it again.
-    public static var ForceRefresh = KingfisherOptions(rawValue: 1 << 1)
-    
-    /// Only cache downloaded image to memory, not cache in disk.
-    public static var CacheMemoryOnly = KingfisherOptions(rawValue: 1 << 2)
-    
-    /// Decode the image in background thread before using.
-    public static var BackgroundDecode = KingfisherOptions(rawValue: 1 << 3)
-
-    /// If set it will dispatch callbacks asynchronously to the global queue DISPATCH_QUEUE_PRIORITY_DEFAULT. Otherwise it will use the queue defined at KingfisherManager.DefaultOptions.queue
-    public static var BackgroundCallback = KingfisherOptions(rawValue: 1 << 4)
-    
-    /// Decode the image using the same scale as the main screen. Otherwise it will use the same scale as defined on the KingfisherManager.DefaultOptions.scale.
-    public static var ScreenScale = KingfisherOptions(rawValue: 1 << 5)
-    
-    // MARK: - Deprecated
-    /// Download in a low priority.
-    @available(*, deprecated=1.10, message="This will be ignored from 1.10. Use `KingfisherOptionsInfoItem.DownloadPriority` and pass it as `KingfisherOptionsInfo` instead.")
-    public static let LowPriority = KingfisherOptions(rawValue: 1 << 0)
-}

+ 0 - 2
Kingfisher/KingfisherOptionsInfo.swift

@@ -42,7 +42,6 @@ Item could be added into KingfisherOptionsInfo
 - DownloadPriority: Item for image download priority. The `Float` value will be set as the priority of image download task. The value for it should be between 0.0~1.0. If this option not set, the default value (`NSURLSessionTaskPriorityDefault`) will be used.
 */
 public enum KingfisherOptionsInfoItem {
-    case Options(KingfisherOptions)
     case TargetCache(ImageCache?)
     case Downloader(ImageDownloader?)
     case Transition(ImageTransition)
@@ -64,7 +63,6 @@ infix operator <== {
 // This operator returns true if two `KingfisherOptionsInfoItem` enum is the same, without considering the associated values.
 func <== (lhs: KingfisherOptionsInfoItem, rhs: KingfisherOptionsInfoItem) -> Bool {
     switch (lhs, rhs) {
-    case (.Options(_), .Options(_)): return true
     case (.TargetCache(_), .TargetCache(_)): return true
     case (.Downloader(_), .Downloader(_)): return true
     case (.Transition(_), .Transition(_)): return true

+ 0 - 64
Kingfisher/UIButton+Kingfisher.swift

@@ -526,67 +526,3 @@ public extension UIButton {
         objc_setAssociatedObject(self, &lastBackgroundURLKey, URLs, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
     }
 }
-
-// MARK: - Deprecated
-public extension UIButton {
-    @available(*, deprecated=1.2, message="Use -kf_setImageWithURL:forState:placeholderImage:optionsInfo: instead.")
-    public func kf_setImageWithURL(URL: NSURL,
-                        forState state: UIControlState,
-                      placeholderImage: UIImage?,
-                               options: KingfisherOptions) -> RetrieveImageTask
-    {
-        return kf_setImageWithURL(URL, forState: state, placeholderImage: placeholderImage, optionsInfo: [.Options(options)], progressBlock: nil, completionHandler: nil)
-    }
-    
-    @available(*, deprecated=1.2, message="Use -kf_setImageWithURL:forState:placeholderImage:optionsInfo:completionHandler: instead.")
-    public func kf_setImageWithURL(URL: NSURL,
-                        forState state: UIControlState,
-                      placeholderImage: UIImage?,
-                               options: KingfisherOptions,
-                     completionHandler: CompletionHandler?) -> RetrieveImageTask
-    {
-        return kf_setImageWithURL(URL, forState: state, placeholderImage: placeholderImage, optionsInfo: [.Options(options)], progressBlock: nil, completionHandler: completionHandler)
-    }
-    
-    @available(*, deprecated=1.2, message="Use -kf_setImageWithURL:forState:placeholderImage:optionsInfo:progressBlock:completionHandler: instead.")
-    public func kf_setImageWithURL(URL: NSURL,
-                        forState state: UIControlState,
-                      placeholderImage: UIImage?,
-                               options: KingfisherOptions,
-                         progressBlock: DownloadProgressBlock?,
-                     completionHandler: CompletionHandler?) -> RetrieveImageTask
-    {
-        return kf_setImageWithURL(URL, forState: state, placeholderImage: placeholderImage, optionsInfo: [.Options(options)], progressBlock: progressBlock, completionHandler: completionHandler)
-    }
-    
-    @available(*, deprecated=1.2, message="Use -kf_setBackgroundImageWithURL:forState:placeholderImage:optionsInfo: instead.")
-    public func kf_setBackgroundImageWithURL(URL: NSURL,
-                                  forState state: UIControlState,
-                                placeholderImage: UIImage?,
-                                         options: KingfisherOptions) -> RetrieveImageTask
-    {
-        return kf_setBackgroundImageWithURL(URL, forState: state, placeholderImage: placeholderImage, optionsInfo: [.Options(options)], progressBlock: nil, completionHandler: nil)
-    }
-    
-    @available(*, deprecated=1.2, message="Use -kf_setBackgroundImageWithURL:forState:placeholderImage:optionsInfo:completionHandler: instead.")
-    public func kf_setBackgroundImageWithURL(URL: NSURL,
-                                  forState state: UIControlState,
-                                placeholderImage: UIImage?,
-                                         options: KingfisherOptions,
-                               completionHandler: CompletionHandler?) -> RetrieveImageTask
-    {
-        return kf_setBackgroundImageWithURL(URL, forState: state, placeholderImage: placeholderImage, optionsInfo: [.Options(options)], progressBlock: nil, completionHandler: completionHandler)
-    }
-    
-    
-    @available(*, deprecated=1.2, message="Use -kf_setBackgroundImageWithURL:forState:placeholderImage:optionsInfo:progressBlock:completionHandler: instead.")
-    public func kf_setBackgroundImageWithURL(URL: NSURL,
-                                  forState state: UIControlState,
-                                placeholderImage: UIImage?,
-                                         options: KingfisherOptions,
-                                   progressBlock: DownloadProgressBlock?,
-                               completionHandler: CompletionHandler?) -> RetrieveImageTask
-    {
-        return kf_setBackgroundImageWithURL(URL, forState: state, placeholderImage: placeholderImage, optionsInfo: [.Options(options)], progressBlock: progressBlock, completionHandler: completionHandler)
-    }
-}

+ 0 - 31
Kingfisher/UIImageView+Kingfisher.swift

@@ -358,34 +358,3 @@ public extension UIImageView {
         objc_setAssociatedObject(self, &imageTaskKey, task, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
     }
 }
-
-// MARK: - Deprecated
-public extension UIImageView {
-    @available(*, deprecated=1.2, message="Use -kf_setImageWithURL:placeholderImage:optionsInfo: instead.")
-    public func kf_setImageWithURL(URL: NSURL,
-                      placeholderImage: UIImage?,
-                               options: KingfisherOptions) -> RetrieveImageTask
-    {
-        return kf_setImageWithURL(URL, placeholderImage: placeholderImage, optionsInfo: [.Options(options)], progressBlock: nil, completionHandler: nil)
-    }
-    
-    @available(*, deprecated=1.2, message="Use -kf_setImageWithURL:placeholderImage:optionsInfo:completionHandler: instead.")
-    public func kf_setImageWithURL(URL: NSURL,
-                      placeholderImage: UIImage?,
-                               options: KingfisherOptions,
-                     completionHandler: CompletionHandler?) -> RetrieveImageTask
-    {
-        return kf_setImageWithURL(URL, placeholderImage: placeholderImage, optionsInfo: [.Options(options)], progressBlock: nil, completionHandler: completionHandler)
-    }
-    
-    @available(*, deprecated=1.2, message="Use -kf_setImageWithURL:placeholderImage:optionsInfo:progressBlock:completionHandler: instead.")
-    public func kf_setImageWithURL(URL: NSURL,
-                      placeholderImage: UIImage?,
-                               options: KingfisherOptions,
-                         progressBlock: DownloadProgressBlock?,
-                     completionHandler: CompletionHandler?) -> RetrieveImageTask
-    {
-        return kf_setImageWithURL(URL, placeholderImage: placeholderImage, optionsInfo: [.Options(options)], progressBlock: progressBlock, completionHandler: completionHandler)
-    }
-    
-}