Skip to content

Commit

Permalink
Merge branch 'master' into swift-2.0
Browse files Browse the repository at this point in the history
# Conflicts:
#	Kingfisher/ImageCache.swift
#	Kingfisher/KingfisherManager.swift
#	Kingfisher/UIButton+Kingfisher.swift
#	Kingfisher/UIImageView+Kingfisher.swift
#	Kingfisher/WKInterfaceImage+Kingfisher.swift
  • Loading branch information
onevcat committed Sep 8, 2015
2 parents 67e3537 + 04caeea commit a8309d3
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 40 deletions.
4 changes: 2 additions & 2 deletions Kingfisher/ImageCache.swift
Original file line number Diff line number Diff line change
Expand Up @@ -233,10 +233,10 @@ extension ImageCache {
Get an image for a key from memory or disk.

- parameter key: Key for the image.
- parameter options: Options of retriving image.
- parameter options: Options of retrieving image.
- parameter completionHandler: Called when getting operation completes with image result and cached type of this image. If there is no such key cached, the image will be `nil`.

- returns: The retriving task.
- returns: The retrieving task.
*/
public func retrieveImageForKey(key: String, options:KingfisherManager.Options, completionHandler: ((UIImage?, CacheType!) -> ())?) -> RetrieveImageDiskTask? {
// No completion handler. Not start working and early return.
Expand Down
4 changes: 2 additions & 2 deletions Kingfisher/KingfisherManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public class KingfisherManager {
- parameter resource: Resource object contains information such as `cacheKey` and `downloadURL`.
- parameter optionsInfo: A dictionary could control some behaviors. See `KingfisherOptionsInfo` for more.
- parameter progressBlock: Called every time downloaded data changed. This could be used as a progress UI.
- parameter completionHandler: Called when the whole retriving process finished.
- parameter completionHandler: Called when the whole retrieving process finished.

- returns: A `RetrieveImageTask` task object. You can use this object to cancel the task.
*/
Expand Down Expand Up @@ -184,7 +184,7 @@ public class KingfisherManager {
- parameter URL: The image URL.
- parameter optionsInfo: A dictionary could control some behaviors. See `KingfisherOptionsInfo` for more.
- parameter progressBlock: Called every time downloaded data changed. This could be used as a progress UI.
- parameter completionHandler: Called when the whole retriving process finished.
- parameter completionHandler: Called when the whole retrieving process finished.

- returns: A `RetrieveImageTask` task object. You can use this object to cancel the task.
*/
Expand Down
40 changes: 20 additions & 20 deletions Kingfisher/UIButton+Kingfisher.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public extension UIButton {
- parameter resource: Resource object contains information such as `cacheKey` and `downloadURL`.
- parameter state: The state that uses the specified image.

- returns: A task represents the retriving process.
- returns: A task represents the retrieving process.
*/
public func kf_setImageWithResource(resource: Resource,
forState state: UIControlState) -> RetrieveImageTask
Expand All @@ -57,7 +57,7 @@ public extension UIButton {
- parameter URL: The URL of image for specified state.
- parameter state: The state that uses the specified image.

- returns: A task represents the retriving process.
- returns: A task represents the retrieving process.
*/
public func kf_setImageWithURL(URL: NSURL,
forState state: UIControlState) -> RetrieveImageTask
Expand All @@ -72,7 +72,7 @@ public extension UIButton {
- parameter state: The state that uses the specified image.
- parameter placeholderImage: A placeholder image when retrieving the image at URL.

- returns: A task represents the retriving process.
- returns: A task represents the retrieving process.
*/
public func kf_setImageWithResource(resource: Resource,
forState state: UIControlState,
Expand All @@ -88,7 +88,7 @@ public extension UIButton {
- parameter state: The state that uses the specified image.
- parameter placeholderImage: A placeholder image when retrieving the image at URL.

- returns: A task represents the retriving process.
- returns: A task represents the retrieving process.
*/
public func kf_setImageWithURL(URL: NSURL,
forState state: UIControlState,
Expand All @@ -105,7 +105,7 @@ public extension UIButton {
- parameter placeholderImage: A placeholder image when retrieving the image at URL.
- parameter optionsInfo: A dictionary could control some behaviors. See `KingfisherOptionsInfo` for more.

- returns: A task represents the retriving process.
- returns: A task represents the retrieving process.
*/
public func kf_setImageWithResource(resource: Resource,
forState state: UIControlState,
Expand All @@ -123,7 +123,7 @@ public extension UIButton {
- parameter placeholderImage: A placeholder image when retrieving the image at URL.
- parameter optionsInfo: A dictionary could control some behaviors. See `KingfisherOptionsInfo` for more.

- returns: A task represents the retriving process.
- returns: A task represents the retrieving process.
*/
public func kf_setImageWithURL(URL: NSURL,
forState state: UIControlState,
Expand All @@ -142,7 +142,7 @@ public extension UIButton {
- parameter optionsInfo: A dictionary could control some behaviors. See `KingfisherOptionsInfo` for more.
- parameter completionHandler: Called when the image retrieved and set.

- returns: A task represents the retriving process.
- returns: A task represents the retrieving process.
*/
public func kf_setImageWithResource(resource: Resource,
forState state: UIControlState,
Expand All @@ -162,7 +162,7 @@ public extension UIButton {
- parameter optionsInfo: A dictionary could control some behaviors. See `KingfisherOptionsInfo` for more.
- parameter completionHandler: Called when the image retrieved and set.

- returns: A task represents the retriving process.
- returns: A task represents the retrieving process.
*/
public func kf_setImageWithURL(URL: NSURL,
forState state: UIControlState,
Expand All @@ -184,7 +184,7 @@ public extension UIButton {
- parameter progressBlock: Called when the image downloading progress gets updated.
- parameter completionHandler: Called when the image retrieved and set.

- returns: A task represents the retriving process.
- returns: A task represents the retrieving process.
*/
public func kf_setImageWithResource(resource: Resource,
forState state: UIControlState,
Expand Down Expand Up @@ -223,7 +223,7 @@ public extension UIButton {
- parameter progressBlock: Called when the image downloading progress gets updated.
- parameter completionHandler: Called when the image retrieved and set.

- returns: A task represents the retriving process.
- returns: A task represents the retrieving process.
*/
public func kf_setImageWithURL(URL: NSURL,
forState state: UIControlState,
Expand Down Expand Up @@ -286,7 +286,7 @@ public extension UIButton {
- parameter resource: Resource object contains information such as `cacheKey` and `downloadURL`.
- parameter state: The state that uses the specified image.

- returns: A task represents the retriving process.
- returns: A task represents the retrieving process.
*/
public func kf_setBackgroundImageWithResource(resource: Resource,
forState state: UIControlState) -> RetrieveImageTask
Expand All @@ -304,7 +304,7 @@ public extension UIButton {
- parameter URL: The URL of image for specified state.
- parameter state: The state that uses the specified image.

- returns: A task represents the retriving process.
- returns: A task represents the retrieving process.
*/
public func kf_setBackgroundImageWithURL(URL: NSURL,
forState state: UIControlState) -> RetrieveImageTask
Expand All @@ -319,7 +319,7 @@ public extension UIButton {
- parameter state: The state that uses the specified image.
- parameter placeholderImage: A placeholder image when retrieving the image at URL.

- returns: A task represents the retriving process.
- returns: A task represents the retrieving process.
*/
public func kf_setBackgroundImageWithResource(resource: Resource,
forState state: UIControlState,
Expand All @@ -335,7 +335,7 @@ public extension UIButton {
- parameter state: The state that uses the specified image.
- parameter placeholderImage: A placeholder image when retrieving the image at URL.

- returns: A task represents the retriving process.
- returns: A task represents the retrieving process.
*/
public func kf_setBackgroundImageWithURL(URL: NSURL,
forState state: UIControlState,
Expand All @@ -352,7 +352,7 @@ public extension UIButton {
- parameter placeholderImage: A placeholder image when retrieving the image at URL.
- parameter optionsInfo: A dictionary could control some behaviors. See `KingfisherOptionsInfo` for more.

- returns: A task represents the retriving process.
- returns: A task represents the retrieving process.
*/
public func kf_setBackgroundImageWithResource(resource: Resource,
forState state: UIControlState,
Expand All @@ -370,7 +370,7 @@ public extension UIButton {
- parameter placeholderImage: A placeholder image when retrieving the image at URL.
- parameter optionsInfo: A dictionary could control some behaviors. See `KingfisherOptionsInfo` for more.

- returns: A task represents the retriving process.
- returns: A task represents the retrieving process.
*/
public func kf_setBackgroundImageWithURL(URL: NSURL,
forState state: UIControlState,
Expand All @@ -389,7 +389,7 @@ public extension UIButton {
- parameter optionsInfo: A dictionary could control some behaviors. See `KingfisherOptionsInfo` for more.
- parameter completionHandler: Called when the image retrieved and set.

- returns: A task represents the retriving process.
- returns: A task represents the retrieving process.
*/
public func kf_setBackgroundImageWithResource(resource: Resource,
forState state: UIControlState,
Expand All @@ -409,7 +409,7 @@ public extension UIButton {
- parameter optionsInfo: A dictionary could control some behaviors. See `KingfisherOptionsInfo` for more.
- parameter completionHandler: Called when the image retrieved and set.

- returns: A task represents the retriving process.
- returns: A task represents the retrieving process.
*/
public func kf_setBackgroundImageWithURL(URL: NSURL,
forState state: UIControlState,
Expand All @@ -431,7 +431,7 @@ public extension UIButton {
- parameter progressBlock: Called when the image downloading progress gets updated.
- parameter completionHandler: Called when the image retrieved and set.

- returns: A task represents the retriving process.
- returns: A task represents the retrieving process.
*/
public func kf_setBackgroundImageWithResource(resource: Resource,
forState state: UIControlState,
Expand Down Expand Up @@ -471,7 +471,7 @@ public extension UIButton {
- parameter progressBlock: Called when the image downloading progress gets updated.
- parameter completionHandler: Called when the image retrieved and set.

- returns: A task represents the retriving process.
- returns: A task represents the retrieving process.
*/
public func kf_setBackgroundImageWithURL(URL: NSURL,
forState state: UIControlState,
Expand Down
20 changes: 10 additions & 10 deletions Kingfisher/UIImageView+Kingfisher.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public extension UIImageView {

- parameter resource: Resource object contains information such as `cacheKey` and `downloadURL`.

- returns: A task represents the retriving process.
- returns: A task represents the retrieving process.
*/
public func kf_setImageWithResource(resource: Resource) -> RetrieveImageTask
{
Expand All @@ -56,7 +56,7 @@ public extension UIImageView {

- parameter URL: The URL of image.

- returns: A task represents the retriving process.
- returns: A task represents the retrieving process.
*/
public func kf_setImageWithURL(URL: NSURL) -> RetrieveImageTask
{
Expand All @@ -69,7 +69,7 @@ public extension UIImageView {
- parameter resource: Resource object contains information such as `cacheKey` and `downloadURL`.
- parameter placeholderImage: A placeholder image when retrieving the image at URL.

- returns: A task represents the retriving process.
- returns: A task represents the retrieving process.
*/
public func kf_setImageWithResource(resource: Resource,
placeholderImage: UIImage?) -> RetrieveImageTask
Expand All @@ -83,7 +83,7 @@ public extension UIImageView {
- parameter URL: The URL of image.
- parameter placeholderImage: A placeholder image when retrieving the image at URL.

- returns: A task represents the retriving process.
- returns: A task represents the retrieving process.
*/
public func kf_setImageWithURL(URL: NSURL,
placeholderImage: UIImage?) -> RetrieveImageTask
Expand All @@ -98,7 +98,7 @@ public extension UIImageView {
- parameter placeholderImage: A placeholder image when retrieving the image at URL.
- parameter optionsInfo: A dictionary could control some behaviors. See `KingfisherOptionsInfo` for more.

- returns: A task represents the retriving process.
- returns: A task represents the retrieving process.
*/
public func kf_setImageWithResource(resource: Resource,
placeholderImage: UIImage?,
Expand All @@ -114,7 +114,7 @@ public extension UIImageView {
- parameter placeholderImage: A placeholder image when retrieving the image at URL.
- parameter optionsInfo: A dictionary could control some behaviors. See `KingfisherOptionsInfo` for more.

- returns: A task represents the retriving process.
- returns: A task represents the retrieving process.
*/
public func kf_setImageWithURL(URL: NSURL,
placeholderImage: UIImage?,
Expand All @@ -131,7 +131,7 @@ public extension UIImageView {
- parameter optionsInfo: A dictionary could control some behaviors. See `KingfisherOptionsInfo` for more.
- parameter completionHandler: Called when the image retrieved and set.

- returns: A task represents the retriving process.
- returns: A task represents the retrieving process.
*/
public func kf_setImageWithResource(resource: Resource,
placeholderImage: UIImage?,
Expand All @@ -149,7 +149,7 @@ public extension UIImageView {
- parameter optionsInfo: A dictionary could control some behaviors. See `KingfisherOptionsInfo` for more.
- parameter completionHandler: Called when the image retrieved and set.

- returns: A task represents the retriving process.
- returns: A task represents the retrieving process.
*/
public func kf_setImageWithURL(URL: NSURL,
placeholderImage: UIImage?,
Expand All @@ -168,7 +168,7 @@ public extension UIImageView {
- parameter progressBlock: Called when the image downloading progress gets updated.
- parameter completionHandler: Called when the image retrieved and set.

- returns: A task represents the retriving process.
- returns: A task represents the retrieving process.
*/
public func kf_setImageWithResource(resource: Resource,
placeholderImage: UIImage?,
Expand Down Expand Up @@ -217,7 +217,7 @@ public extension UIImageView {
- parameter progressBlock: Called when the image downloading progress gets updated.
- parameter completionHandler: Called when the image retrieved and set.

- returns: A task represents the retriving process.
- returns: A task represents the retrieving process.
*/

public func kf_setImageWithURL(URL: NSURL,
Expand Down
12 changes: 6 additions & 6 deletions KingfisherTests/ImageCacheTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class ImageCacheTests: XCTestCase {
}

func testClearMemoryCache() {
let expectation = expectationWithDescription("wait for retriving image")
let expectation = expectationWithDescription("wait for retrieving image")

cache.storeImage(testImage, forKey: testKeys[0], toDisk: true) { () -> () in
self.cache.clearMemoryCache()
Expand All @@ -101,7 +101,7 @@ class ImageCacheTests: XCTestCase {
}

func testNoImageFound() {
let expectation = expectationWithDescription("wait for retriving image")
let expectation = expectationWithDescription("wait for retrieving image")

cache.clearDiskCacheWithCompletionHandler { () -> () in
self.cache.retrieveImageForKey(testKeys[0], options: KingfisherManager.OptionsNone, completionHandler: { (image, type) -> () in
Expand All @@ -115,7 +115,7 @@ class ImageCacheTests: XCTestCase {
}

func testStoreImageInMemory() {
let expectation = expectationWithDescription("wait for retriving image")
let expectation = expectationWithDescription("wait for retrieving image")

cache.storeImage(testImage, forKey: testKeys[0], toDisk: false) { () -> () in
self.cache.retrieveImageForKey(testKeys[0], options: KingfisherManager.OptionsNone, completionHandler: { (image, type) -> () in
Expand Down Expand Up @@ -163,9 +163,9 @@ class ImageCacheTests: XCTestCase {
self.waitForExpectationsWithTimeout(5, handler: nil)
}

func testRetrivingImagePerformance() {
func testRetrievingImagePerformance() {

let expectation = self.expectationWithDescription("wait for retriving image")
let expectation = self.expectationWithDescription("wait for retrieving image")
self.cache.storeImage(testImage, forKey: testKeys[0], toDisk: true) { () -> () in
self.measureBlock({ () -> Void in
for _ in 1 ..< 1000 {
Expand All @@ -179,7 +179,7 @@ class ImageCacheTests: XCTestCase {
}

func testCleanDiskCacheNotification() {
let expectation = expectationWithDescription("wait for retriving image")
let expectation = expectationWithDescription("wait for retrieving image")

cache.storeImage(testImage, forKey: testKeys[0], toDisk: true) { () -> () in

Expand Down

0 comments on commit a8309d3

Please sign in to comment.