Skip to content

Commit fb8e9c7

Browse files
author
Christian Elies
committed
docs(readme): updated readme
1 parent 0b1ca98 commit fb8e9c7

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,24 @@ RemoteImage(type: .phAsset(localIdentifier: "541D4013-D51C-463C-AD85-0A1E4EA838F
5353
})
5454
```
5555

56+
## Custom cache
57+
58+
The `RemoteImageService` uses a default cache. To use a custom one just conform to the protocol `RemoteImageCache` and set it on the type `RemoteImageService`.
59+
60+
```swift
61+
RemoteImageService.cache = yourCache
62+
```
63+
64+
## Custom cache key
65+
66+
The default cache uses the associated value of the related `RemoteImageType` as the key. You can customize this by setting a cache key provider through
67+
68+
```swift
69+
RemoteImageService.cacheKeyProvider = { remoteImageType -> AnyObject in
70+
// return a key here
71+
}
72+
```
73+
5674
## Migration from 0.1.0 -> 1.0.0
5775

5876
The `url parameter` was refactored to a `type parameter` which makes it easy to fetch images at a URL or from the iCloud.

0 commit comments

Comments
 (0)