Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
JanGorman committed Jun 27, 2017
1 parent 50ce366 commit 06bcfb2
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,22 +82,18 @@ This shows a way of keeping the zoomed library and the one in the background syn

### Custom Download Handler

If you want to take control of downloading images (e.g. for caching), you can also set a download closure that calls back to Agrume to set the image. I can recommend [MapleBacon](https://github.com/zalando/MapleBacon).
If you want to take control of downloading images (e.g. for caching), you can also set a download closure that calls back to Agrume to set the image. For example, let's use [Kingfisher](https://github.com/onevcat/Kingfisher).

```swift
import Agrume
import MapleBacon
import Kingfisher

@IBAction func openURL(_ sender: Any) {
let agrume = Agrume(imageUrl: URL(string: "https://dl.dropboxusercontent.com/u/512759/MapleBacon.png")!, backgroundBlurStyle: .light)
agrume.download = { url, completion in
ImageDownloader.downloadImage(url) { image in
if let image = image {
completion(image)
} else {
completion(nil)
}
}
ImageDownloader.default.downloadImage(with: url, options: [], progressBlock: nil) { image, _, _, _ in
completion(image)
}
}
agrume.showFrom(self)
}
Expand Down

0 comments on commit 06bcfb2

Please sign in to comment.