Browse Source

Rename placeholderImage to placeholder

onevcat 9 years ago
parent
commit
cd03761bae

+ 10 - 8
Demo/Kingfisher-Demo/ViewController.swift

@@ -67,14 +67,16 @@ extension ViewController {
         
         let url = URL(string: "https://raw.githubusercontent.com/onevcat/Kingfisher/master/images/kingfisher-\(indexPath.row + 1).jpg")!
         
-        _ = cell.cellImageView.kf_setImage(with: url, placeholderImage: nil,
-                                                        optionsInfo: [.transition(ImageTransition.fade(1))],
-                                                      progressBlock: { receivedSize, totalSize in
-                                                          print("\(indexPath.row + 1): \(receivedSize)/\(totalSize)")
-                                                      },
-                                                  completionHandler: { image, error, cacheType, imageURL in
-                                                          print("\(indexPath.row + 1): Finished")
-                                                      })
+        
+        _ = cell.cellImageView.kf_setImage(with: url,
+                                           placeholder: nil,
+                                           optionsInfo: [.transition(ImageTransition.fade(1))],
+                                           progressBlock: { receivedSize, totalSize in
+                                                print("\(indexPath.row + 1): \(receivedSize)/\(totalSize)")
+                                           },
+                                           completionHandler: { image, error, cacheType, imageURL in
+                                                print("\(indexPath.row + 1): Finished")
+        })
         return cell
     }
 }

+ 1 - 1
Demo/Kingfisher-macOS-Demo/ViewController.swift

@@ -58,7 +58,7 @@ extension ViewController: NSCollectionViewDataSource {
         let url = URL(string: "https://raw.githubusercontent.com/onevcat/Kingfisher/master/images/kingfisher-\(indexPath.item + 1).jpg")!
         
         item.imageView?.kf_showIndicatorWhenLoading = true
-        item.imageView?.kf_setImage(with: url, placeholderImage: nil, optionsInfo: nil,
+        item.imageView?.kf_setImage(with: url, placeholder: nil, optionsInfo: nil,
                                                    progressBlock: { receivedSize, totalSize in
                                                     print("\(indexPath.item + 1): \(receivedSize)/\(totalSize)")
                                                     },

+ 3 - 3
Sources/ImageView+Kingfisher.swift

@@ -45,7 +45,7 @@ extension ImageView {
     Set an image with a resource, a placeholder image, options, progress handler and completion handler.
     
     - parameter resource:          Resource object contains information such as `cacheKey` and `downloadURL`.
-    - parameter placeholderImage:  A placeholder image when retrieving the image at URL.
+    - parameter placeholder:       A placeholder image when retrieving the image at URL.
     - parameter optionsInfo:       A dictionary could control some behaviors. See `KingfisherOptionsInfo` for more.
     - parameter progressBlock:     Called when the image downloading progress gets updated.
     - parameter completionHandler: Called when the image retrieved and set.
@@ -57,12 +57,12 @@ extension ImageView {
     */
     @discardableResult
     public func kf_setImage(with resource: Resource?,
-                         placeholderImage: Image? = nil,
+                              placeholder: Image? = nil,
                               optionsInfo: KingfisherOptionsInfo? = nil,
                             progressBlock: DownloadProgressBlock? = nil,
                         completionHandler: CompletionHandler? = nil) -> RetrieveImageTask
     {
-        image = placeholderImage
+        image = placeholder
         
         guard let resource = resource else {
             completionHandler?(nil, nil, .none, nil)

+ 6 - 6
Sources/NSButton+Kingfisher.swift

@@ -37,7 +37,7 @@ extension NSButton {
      Set an image with a resource, a placeholder image, options, progress handler and completion handler.
 
      - parameter resource:          Resource object contains information such as `cacheKey` and `downloadURL`.
-     - parameter placeholderImage:  A placeholder image when retrieving the image at URL.
+     - parameter placeholder:       A placeholder image when retrieving the image at URL.
      - parameter optionsInfo:       A dictionary could control some behaviors. See `KingfisherOptionsInfo` for more.
      - parameter progressBlock:     Called when the image downloading progress gets updated.
      - parameter completionHandler: Called when the image retrieved and set.
@@ -49,12 +49,12 @@ extension NSButton {
      */
     @discardableResult
     public func kf_setImage(with resource: Resource?,
-                         placeholderImage: Image? = nil,
+                              placeholder: Image? = nil,
                               optionsInfo: KingfisherOptionsInfo? = nil,
                             progressBlock: DownloadProgressBlock? = nil,
                         completionHandler: CompletionHandler? = nil) -> RetrieveImageTask
     {
-        image = placeholderImage
+        image = placeholder
         
         guard let resource = resource else {
             completionHandler?(nil, nil, .none, nil)
@@ -123,7 +123,7 @@ extension NSButton {
      Set an alternateImage with a resource, a placeholder image, options, progress handler and completion handler.
 
      - parameter resource:          Resource object contains information such as `cacheKey` and `downloadURL`.
-     - parameter placeholderImage:  A placeholder image when retrieving the image at URL.
+     - parameter placeholder:       A placeholder image when retrieving the image at URL.
      - parameter optionsInfo:       A dictionary could control some behaviors. See `KingfisherOptionsInfo` for more.
      - parameter progressBlock:     Called when the image downloading progress gets updated.
      - parameter completionHandler: Called when the image retrieved and set.
@@ -135,12 +135,12 @@ extension NSButton {
      */
     @discardableResult
     public func kf_setAlternateImage(with resource: Resource?,
-                                  placeholderImage: Image? = nil,
+                                       placeholder: Image? = nil,
                                        optionsInfo: KingfisherOptionsInfo? = nil,
                                      progressBlock: DownloadProgressBlock? = nil,
                                  completionHandler: CompletionHandler? = nil) -> RetrieveImageTask
     {
-        alternateImage = placeholderImage
+        alternateImage = placeholder
         
         guard let resource = resource else {
             completionHandler?(nil, nil, .none, nil)

+ 6 - 6
Sources/UIButton+Kingfisher.swift

@@ -35,7 +35,7 @@ extension UIButton {
     
     - parameter resource:          Resource object contains information such as `cacheKey` and `downloadURL`.
     - parameter state:             The state that uses the specified image.
-    - parameter placeholderImage:  A placeholder image when retrieving the image at URL.
+    - parameter placeholder:       A placeholder image when retrieving the image at URL.
     - parameter optionsInfo:       A dictionary could control some behaviors. See `KingfisherOptionsInfo` for more.
     - parameter progressBlock:     Called when the image downloading progress gets updated.
     - parameter completionHandler: Called when the image retrieved and set.
@@ -48,12 +48,12 @@ extension UIButton {
     @discardableResult
     public func kf_setImage(with resource: Resource?,
                                 for state: UIControlState,
-                         placeholderImage: UIImage? = nil,
+                              placeholder: UIImage? = nil,
                               optionsInfo: KingfisherOptionsInfo? = nil,
                             progressBlock: DownloadProgressBlock? = nil,
                         completionHandler: CompletionHandler? = nil) -> RetrieveImageTask
     {
-        setImage(placeholderImage, for: state)
+        setImage(placeholder, for: state)
         
         guard let resource = resource else {
             completionHandler?(nil, nil, .none, nil)
@@ -140,7 +140,7 @@ extension UIButton {
     
     - parameter resource:          Resource object contains information such as `cacheKey` and `downloadURL`.
     - parameter state:             The state that uses the specified image.
-    - parameter placeholderImage:  A placeholder image when retrieving the image at URL.
+    - parameter placeholder:       A placeholder image when retrieving the image at URL.
     - parameter optionsInfo:       A dictionary could control some behaviors. See `KingfisherOptionsInfo` for more.
     - parameter progressBlock:     Called when the image downloading progress gets updated.
     - parameter completionHandler: Called when the image retrieved and set.
@@ -153,12 +153,12 @@ extension UIButton {
     @discardableResult
     public func kf_setBackgroundImage(with resource: Resource?,
                                           for state: UIControlState,
-                                   placeholderImage: UIImage? = nil,
+                                        placeholder: UIImage? = nil,
                                         optionsInfo: KingfisherOptionsInfo? = nil,
                                       progressBlock: DownloadProgressBlock? = nil,
                                   completionHandler: CompletionHandler? = nil) -> RetrieveImageTask
     {
-        setBackgroundImage(placeholderImage, for: state)
+        setBackgroundImage(placeholder, for: state)
         
         guard let resource = resource else {
             completionHandler?(nil, nil, .none, nil)

+ 21 - 21
Tests/KingfisherTests/ImageViewExtensionTests.swift

@@ -68,7 +68,7 @@ class ImageViewExtensionTests: XCTestCase {
         
         var progressBlockIsCalled = false
         
-        imageView.kf_setImage(with: url, placeholderImage: nil, optionsInfo: nil, progressBlock: { (receivedSize, totalSize) -> () in
+        imageView.kf_setImage(with: url, placeholder: nil, optionsInfo: nil, progressBlock: { (receivedSize, totalSize) -> () in
             progressBlockIsCalled = true
             XCTAssertTrue(Thread.isMainThread)
         }) { (image, error, cacheType, imageURL) -> () in
@@ -95,7 +95,7 @@ class ImageViewExtensionTests: XCTestCase {
         let url = URL(string: URLString)!
         
         let customQueue = DispatchQueue(label: "com.kingfisher.testQueue")
-        imageView.kf_setImage(with: url, placeholderImage: nil, optionsInfo: [.callbackDispatchQueue(customQueue)], progressBlock: { (receivedSize, totalSize) -> () in
+        imageView.kf_setImage(with: url, placeholder: nil, optionsInfo: [.callbackDispatchQueue(customQueue)], progressBlock: { (receivedSize, totalSize) -> () in
             XCTAssertTrue(Thread.isMainThread)
         }) { (image, error, cacheType, imageURL) -> () in
             XCTAssertTrue(Thread.isMainThread, "The image extension callback should be always in main queue.")
@@ -117,7 +117,7 @@ class ImageViewExtensionTests: XCTestCase {
         
         cleanDefaultCache()
         
-        _ = imageView.kf_setImage(with: resource, placeholderImage: nil, optionsInfo: nil, progressBlock: { (receivedSize, totalSize) -> () in
+        _ = imageView.kf_setImage(with: resource, placeholder: nil, optionsInfo: nil, progressBlock: { (receivedSize, totalSize) -> () in
             progressBlockIsCalled = true
             }) { (image, error, cacheType, imageURL) -> () in
                 expectation.fulfill()
@@ -144,7 +144,7 @@ class ImageViewExtensionTests: XCTestCase {
         var progressBlockIsCalled = false
         var completionBlockIsCalled = false
         
-        let task = imageView.kf_setImage(with: url, placeholderImage: nil, optionsInfo: nil, progressBlock: { (receivedSize, totalSize) -> () in
+        let task = imageView.kf_setImage(with: url, placeholder: nil, optionsInfo: nil, progressBlock: { (receivedSize, totalSize) -> () in
             progressBlockIsCalled = true
         }) { (image, error, cacheType, imageURL) -> () in
             completionBlockIsCalled = true
@@ -173,7 +173,7 @@ class ImageViewExtensionTests: XCTestCase {
         
         cleanDefaultCache()
         
-        let task = imageView.kf_setImage(with: url, placeholderImage: nil, optionsInfo: nil, progressBlock: { (receivedSize, totalSize) -> () in
+        let task = imageView.kf_setImage(with: url, placeholder: nil, optionsInfo: nil, progressBlock: { (receivedSize, totalSize) -> () in
             progressBlockIsCalled = true
             }) { (image, error, cacheType, imageURL) -> () in
                 XCTAssertNotNil(error)
@@ -206,20 +206,20 @@ class ImageViewExtensionTests: XCTestCase {
         var task2Completion = false
         var task3Completion = false
         
-        let task1 = imageView.kf_setImage(with: url, placeholderImage: nil, optionsInfo: nil, progressBlock: { (receivedSize, totalSize) -> () in
+        let task1 = imageView.kf_setImage(with: url, placeholder: nil, optionsInfo: nil, progressBlock: { (receivedSize, totalSize) -> () in
 
             }) { (image, error, cacheType, imageURL) -> () in
                 task1Completion = true
         }
         
-        let _ = imageView.kf_setImage(with: url, placeholderImage: nil, optionsInfo: nil, progressBlock: { (receivedSize, totalSize) -> () in
+        let _ = imageView.kf_setImage(with: url, placeholder: nil, optionsInfo: nil, progressBlock: { (receivedSize, totalSize) -> () in
             
             }) { (image, error, cacheType, imageURL) -> () in
                 XCTAssertNotNil(image)
                 task2Completion = true
         }
         
-        let _ = imageView.kf_setImage(with: url, placeholderImage: nil, optionsInfo: nil, progressBlock: { (receivedSize, totalSize) -> () in
+        let _ = imageView.kf_setImage(with: url, placeholder: nil, optionsInfo: nil, progressBlock: { (receivedSize, totalSize) -> () in
             
             }) { (image, error, cacheType, imageURL) -> () in
                 XCTAssertNotNil(image)
@@ -252,21 +252,21 @@ class ImageViewExtensionTests: XCTestCase {
         var task2Completion = false
         var task3Completion = false
         
-        let task1 = imageView.kf_setImage(with: url, placeholderImage: nil, optionsInfo: nil, progressBlock: { (receivedSize, totalSize) -> () in
+        let task1 = imageView.kf_setImage(with: url, placeholder: nil, optionsInfo: nil, progressBlock: { (receivedSize, totalSize) -> () in
             
             }) { (image, error, cacheType, imageURL) -> () in
                 XCTAssertNotNil(image)
                 task1Completion = true
         }
         
-        let _ = imageView.kf_setImage(with: url, placeholderImage: nil, optionsInfo: nil, progressBlock: { (receivedSize, totalSize) -> () in
+        let _ = imageView.kf_setImage(with: url, placeholder: nil, optionsInfo: nil, progressBlock: { (receivedSize, totalSize) -> () in
             
             }) { (image, error, cacheType, imageURL) -> () in
                 XCTAssertNotNil(image)
                 task2Completion = true
         }
         
-        let _ = imageView.kf_setImage(with: url, placeholderImage: nil, optionsInfo: nil, progressBlock: { (receivedSize, totalSize) -> () in
+        let _ = imageView.kf_setImage(with: url, placeholder: nil, optionsInfo: nil, progressBlock: { (receivedSize, totalSize) -> () in
             
             }) { (image, error, cacheType, imageURL) -> () in
                 XCTAssertNotNil(image)
@@ -299,7 +299,7 @@ class ImageViewExtensionTests: XCTestCase {
         var task2Completion = false
         var task3Completion = false
         
-        let task1 = imageView.kf_setImage(with: url, placeholderImage: nil, optionsInfo: nil, progressBlock: { (receivedSize, totalSize) -> () in
+        let task1 = imageView.kf_setImage(with: url, placeholder: nil, optionsInfo: nil, progressBlock: { (receivedSize, totalSize) -> () in
             
             }) { (image, error, cacheType, imageURL) -> () in
                 XCTAssertNotNil(error)
@@ -307,7 +307,7 @@ class ImageViewExtensionTests: XCTestCase {
                 task1Completion = true
         }
         
-        let task2 = imageView.kf_setImage(with: url, placeholderImage: nil, optionsInfo: nil, progressBlock: { (receivedSize, totalSize) -> () in
+        let task2 = imageView.kf_setImage(with: url, placeholder: nil, optionsInfo: nil, progressBlock: { (receivedSize, totalSize) -> () in
             
             }) { (image, error, cacheType, imageURL) -> () in
                 XCTAssertNotNil(error)
@@ -315,7 +315,7 @@ class ImageViewExtensionTests: XCTestCase {
                 task2Completion = true
         }
         
-        let task3 = imageView.kf_setImage(with: url, placeholderImage: nil, optionsInfo: nil, progressBlock: { (receivedSize, totalSize) -> () in
+        let task3 = imageView.kf_setImage(with: url, placeholder: nil, optionsInfo: nil, progressBlock: { (receivedSize, totalSize) -> () in
             
             }) { (image, error, cacheType, imageURL) -> () in
                 XCTAssertNotNil(error)
@@ -354,7 +354,7 @@ class ImageViewExtensionTests: XCTestCase {
         _ = stubRequest("GET", URLString).andReturn(200)?.withBody(testImageData)
         let url = URL(string: URLString)!
         
-        imageView.kf_setImage(with: url, placeholderImage: nil, optionsInfo: [.targetCache(cache1)], progressBlock: { (receivedSize, totalSize) -> () in
+        imageView.kf_setImage(with: url, placeholder: nil, optionsInfo: [.targetCache(cache1)], progressBlock: { (receivedSize, totalSize) -> () in
             
         }) { (image, error, cacheType, imageURL) -> () in
             
@@ -362,7 +362,7 @@ class ImageViewExtensionTests: XCTestCase {
             XCTAssertFalse(cache2.isImageCachedForKey(URLString).cached, "This image should not be cached in cache2.")
             XCTAssertFalse(KingfisherManager.shared.cache.isImageCachedForKey(URLString).cached, "This image should not be cached in default cache.")
             
-            self.imageView.kf_setImage(with: url, placeholderImage: nil, optionsInfo: [.targetCache(cache2)], progressBlock: { (receivedSize, totalSize) -> () in
+            self.imageView.kf_setImage(with: url, placeholder: nil, optionsInfo: [.targetCache(cache2)], progressBlock: { (receivedSize, totalSize) -> () in
                 
             }, completionHandler: { (image, error, cacheType, imageURL) -> () in
                 
@@ -399,7 +399,7 @@ class ImageViewExtensionTests: XCTestCase {
         _ = stubRequest("GET", URLString).andReturn(200)?.withBody(testImageData)
         let url = URL(string: URLString)!
         
-        imageView.kf_setImage(with: url, placeholderImage: nil, optionsInfo: nil, progressBlock: { (receivedSize, totalSize) -> () in
+        imageView.kf_setImage(with: url, placeholder: nil, optionsInfo: nil, progressBlock: { (receivedSize, totalSize) -> () in
             
             let indicator = self.imageView.kf_indicator
             XCTAssertNotNil(indicator, "The indicator view should exist when showIndicatorWhenLoading is true")
@@ -421,7 +421,7 @@ class ImageViewExtensionTests: XCTestCase {
         let stub = stubRequest("GET", URLString).andReturn(200)?.withBody(testImageData)?.delay()
         let url = URL(string: URLString)!
         
-        imageView.kf_setImage(with: url, placeholderImage: nil, optionsInfo: nil, progressBlock: { (receivedSize, totalSize) -> () in
+        imageView.kf_setImage(with: url, placeholder: nil, optionsInfo: nil, progressBlock: { (receivedSize, totalSize) -> () in
                 XCTFail("Progress block should not be called.")
             }) { (image, error, cacheType, imageURL) -> () in
                 XCTAssertNotNil(error)
@@ -449,7 +449,7 @@ class ImageViewExtensionTests: XCTestCase {
         var task1Complete = false
         var task2Complete = false
         
-        imageView.kf_setImage(with: URLs[0], placeholderImage: nil, optionsInfo: nil, progressBlock: { (receivedSize, totalSize) -> () in
+        imageView.kf_setImage(with: URLs[0], placeholder: nil, optionsInfo: nil, progressBlock: { (receivedSize, totalSize) -> () in
             
             }) { (image, error, cacheType, imageURL) -> () in
                 task1Complete = true
@@ -458,7 +458,7 @@ class ImageViewExtensionTests: XCTestCase {
                 XCTAssertNotEqual(self.imageView.image, image)
         }
         
-        self.imageView.kf_setImage(with: URLs[1], placeholderImage: nil, optionsInfo: nil, progressBlock: { (receivedSize, totalSize) -> () in
+        self.imageView.kf_setImage(with: URLs[1], placeholder: nil, optionsInfo: nil, progressBlock: { (receivedSize, totalSize) -> () in
             
             }) { (image, error, cacheType, imageURL) -> () in
                 task2Complete = true
@@ -481,7 +481,7 @@ class ImageViewExtensionTests: XCTestCase {
         let expectation = self.expectation(description: "wait for downloading image")
         
         let url: URL? = nil
-        imageView.kf_setImage(with: url, placeholderImage: nil, optionsInfo: nil, progressBlock: { (receivedSize, totalSize) -> () in
+        imageView.kf_setImage(with: url, placeholder: nil, optionsInfo: nil, progressBlock: { (receivedSize, totalSize) -> () in
             XCTFail("Progress block should not be called.")
         }) { (image, error, cacheType, imageURL) -> () in
             XCTAssertNil(image)

+ 5 - 5
Tests/KingfisherTests/NSButtonExtensionTests.swift

@@ -71,7 +71,7 @@ class NSButtonExtensionTests: XCTestCase {
 
         cleanDefaultCache()
 
-        button.kf_setImage(with: url, placeholderImage: nil, optionsInfo: nil, progressBlock: { (receivedSize, totalSize) -> () in
+        button.kf_setImage(with: url, placeholder: nil, optionsInfo: nil, progressBlock: { (receivedSize, totalSize) -> () in
             progressBlockIsCalled = true
         }) { (image, error, cacheType, imageURL) -> () in
             expectation.fulfill()
@@ -94,7 +94,7 @@ class NSButtonExtensionTests: XCTestCase {
         let url = URL(string: URLString)!
 
         var progressBlockIsCalled = false
-        button.kf_setAlternateImage(with: url, placeholderImage: nil, optionsInfo: nil, progressBlock: { (receivedSize, totalSize) -> () in
+        button.kf_setAlternateImage(with: url, placeholder: nil, optionsInfo: nil, progressBlock: { (receivedSize, totalSize) -> () in
             progressBlockIsCalled = true
         }) { (image, error, cacheType, imageURL) -> () in
             expectation.fulfill()
@@ -117,7 +117,7 @@ class NSButtonExtensionTests: XCTestCase {
         let stub = stubRequest("GET", URLString).andReturn(200)?.withBody(testImageData)?.delay()
         let url = URL(string: URLString)!
 
-        button.kf_setImage(with: url, placeholderImage: nil, optionsInfo: nil, progressBlock: { (receivedSize, totalSize) -> () in
+        button.kf_setImage(with: url, placeholder: nil, optionsInfo: nil, progressBlock: { (receivedSize, totalSize) -> () in
             XCTFail("Progress block should not be called.")
         }) { (image, error, cacheType, imageURL) -> () in
             XCTAssertNotNil(error)
@@ -141,7 +141,7 @@ class NSButtonExtensionTests: XCTestCase {
         let stub = stubRequest("GET", URLString).andReturn(200)?.withBody(testImageData)?.delay()
         let url = URL(string: URLString)!
 
-        _ = button.kf_setAlternateImage(with: url, placeholderImage: nil, optionsInfo: nil, progressBlock: { (receivedSize, totalSize) -> () in
+        _ = button.kf_setAlternateImage(with: url, placeholder: nil, optionsInfo: nil, progressBlock: { (receivedSize, totalSize) -> () in
             XCTFail("Progress block should not be called.")
         }) { (image, error, cacheType, imageURL) -> () in
             XCTAssertNotNil(error)
@@ -162,7 +162,7 @@ class NSButtonExtensionTests: XCTestCase {
         let expectation = self.expectation(description: "wait for downloading image")
         
         let url: URL? = nil
-        button.kf_setAlternateImage(with: url, placeholderImage: nil, optionsInfo: nil, progressBlock: { (receivedSize, totalSize) -> () in
+        button.kf_setAlternateImage(with: url, placeholder: nil, optionsInfo: nil, progressBlock: { (receivedSize, totalSize) -> () in
             XCTFail("Progress block should not be called.")
         }) { (image, error, cacheType, imageURL) -> () in
             XCTAssertNil(image)

+ 5 - 5
Tests/KingfisherTests/UIButtonExtensionTests.swift

@@ -71,7 +71,7 @@ class UIButtonExtensionTests: XCTestCase {
         
         cleanDefaultCache()
         
-        button.kf_setImage(with: url, for: .highlighted, placeholderImage: nil, optionsInfo: nil, progressBlock: { (receivedSize, totalSize) -> () in
+        button.kf_setImage(with: url, for: .highlighted, placeholder: nil, optionsInfo: nil, progressBlock: { (receivedSize, totalSize) -> () in
             progressBlockIsCalled = true
         }) { (image, error, cacheType, imageURL) -> () in
             expectation.fulfill()
@@ -94,7 +94,7 @@ class UIButtonExtensionTests: XCTestCase {
         let url = Foundation.URL(string: URLString)!
         
         var progressBlockIsCalled = false
-        button.kf_setBackgroundImage(with: url, for: .normal, placeholderImage: nil, optionsInfo: nil, progressBlock: { (receivedSize, totalSize) -> () in
+        button.kf_setBackgroundImage(with: url, for: .normal, placeholder: nil, optionsInfo: nil, progressBlock: { (receivedSize, totalSize) -> () in
             progressBlockIsCalled = true
             }) { (image, error, cacheType, imageURL) -> () in
                 expectation.fulfill()
@@ -117,7 +117,7 @@ class UIButtonExtensionTests: XCTestCase {
         let stub = stubRequest("GET", URLString).andReturn(200)?.withBody(testImageData)?.delay()
         let url = URL(string: URLString)!
 
-        button.kf_setImage(with: url, for: UIControlState.highlighted, placeholderImage: nil, optionsInfo: nil, progressBlock: { (receivedSize, totalSize) -> () in
+        button.kf_setImage(with: url, for: UIControlState.highlighted, placeholder: nil, optionsInfo: nil, progressBlock: { (receivedSize, totalSize) -> () in
                 XCTFail("Progress block should not be called.")
             }) { (image, error, cacheType, imageURL) -> () in
                 XCTAssertNotNil(error)
@@ -140,7 +140,7 @@ class UIButtonExtensionTests: XCTestCase {
         let stub = stubRequest("GET", URLString).andReturn(200)?.withBody(testImageData)?.delay()
         let url = URL(string: URLString)!
         
-        button.kf_setBackgroundImage(with: url, for: UIControlState(), placeholderImage: nil, optionsInfo: nil, progressBlock: { (receivedSize, totalSize) -> () in
+        button.kf_setBackgroundImage(with: url, for: UIControlState(), placeholder: nil, optionsInfo: nil, progressBlock: { (receivedSize, totalSize) -> () in
             XCTFail("Progress block should not be called.")
             }) { (image, error, cacheType, imageURL) -> () in
                 XCTAssertNotNil(error)
@@ -160,7 +160,7 @@ class UIButtonExtensionTests: XCTestCase {
         let expectation = self.expectation(description: "wait for downloading image")
         
         let url: URL? = nil
-        button.kf_setBackgroundImage(with: url, for: UIControlState(), placeholderImage: nil, optionsInfo: nil, progressBlock: { (receivedSize, totalSize) -> () in
+        button.kf_setBackgroundImage(with: url, for: UIControlState(), placeholder: nil, optionsInfo: nil, progressBlock: { (receivedSize, totalSize) -> () in
             XCTFail("Progress block should not be called.")
         }) { (image, error, cacheType, imageURL) -> () in
             XCTAssertNil(image)