|
|
@@ -3,11 +3,11 @@
|
|
|
</p>
|
|
|
|
|
|
<p align="center">
|
|
|
-<a href="https://circleci.com/gh/onevcat/Kingfisher"><img src="https://img.shields.io/circleci/project/onevcat/Kingfisher/master.svg"></a>
|
|
|
-<a href="https://github.com/Carthage/Carthage/"><img src="https://img.shields.io/badge/Carthage-✔-f2a77e.svg?style=flat"></a>
|
|
|
-<a href="http://cocoadocs.org/docsets/Kingfisher"><img src="https://img.shields.io/cocoapods/v/Kingfisher.svg?style=flat"></a>
|
|
|
-<a href="https://raw.githubusercontent.com/onevcat/Kingfisher/master/LICENSE"><img src="https://img.shields.io/cocoapods/l/Kingfisher.svg?style=flat"></a>
|
|
|
-<a href="http://cocoadocs.org/docsets/Kingfisher"><img src="https://img.shields.io/cocoapods/p/Kingfisher.svg?style=flat"></a>
|
|
|
+<a href="https://circleci.com/gh/onevcat/Kingfisher"><img src="https://img.shields.io/circleci/project/onevcat/Kingfisher/master.svg"></a>
|
|
|
+<a href="https://github.com/Carthage/Carthage/"><img src="https://img.shields.io/badge/Carthage-✔-f2a77e.svg?style=flat"></a>
|
|
|
+<a href="http://cocoadocs.org/docsets/Kingfisher"><img src="https://img.shields.io/cocoapods/v/Kingfisher.svg?style=flat"></a>
|
|
|
+<a href="https://raw.githubusercontent.com/onevcat/Kingfisher/master/LICENSE"><img src="https://img.shields.io/cocoapods/l/Kingfisher.svg?style=flat"></a>
|
|
|
+<a href="http://cocoadocs.org/docsets/Kingfisher"><img src="https://img.shields.io/cocoapods/p/Kingfisher.svg?style=flat"></a>
|
|
|
<img src="https://img.shields.io/badge/made%20with-%3C3-orange.svg">
|
|
|
</p>
|
|
|
|
|
|
@@ -141,6 +141,17 @@ In most cases, Kingfisher is used in a reusable cell. Since the downloading proc
|
|
|
imageView.kf_setImageWithURL(NSURL(string: "http://your_image_url.png")!, placeholderImage: nil)
|
|
|
```
|
|
|
|
|
|
+By default, `Kingfisher` will use `absoluteString` of the URL as the key for cache. If you need another key instead of URL's `absoluteString`, there is another set of APIs accepting `Resource` as parameter:
|
|
|
+
|
|
|
+```swift
|
|
|
+let URL = NSURL(string: "http://your_image_url.png")!
|
|
|
+let resource = Resource(downloadURL: URL, cacheKey: "your_customized_key")
|
|
|
+
|
|
|
+imageView.kf_setImageWithResource(resource)
|
|
|
+```
|
|
|
+
|
|
|
+It will ask Kingfisher's manager to get the image for the "your_customized_key" from memory and disk first. If the manager does not find it, it will try to download the image at the URL, and store it with `cacheKey` ("your_customized_key" here) for next use.
|
|
|
+
|
|
|
#### Options
|
|
|
|
|
|
Kingfisher will search in cache (both memory and disk) first with the URL, if no image found, it will try to download and store the image in the cache. You can change this behavior by passing an option dictionary, to let it ignore the cache.
|