Skip to content

Commit

Permalink
Merge pull request #43 from viktorgardart/patch-1
Browse files Browse the repository at this point in the history
🌹 Updated readme examples to correct syntax.
  • Loading branch information
vadymmarkov authored Mar 31, 2017
2 parents b1c0347 + 708ad02 commit e6fe08f
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,26 @@ a bunch of built-in unicorny features:
### Set image with URL

```swift
let imageView: UIImageView()
let imageUrl: URL(string: "https://avatars2.githubusercontent.com/u/1340892?v=3&s=200")
let imageView = UIImageView()
let imageUrl = URL(string: "https://avatars2.githubusercontent.com/u/1340892?v=3&s=200")

imageView.setImage(url: imageUrl)
```

### Apply placeholder images

```swift
let imageView: UIImageView()
let imageView = UIImageView()
let placeholder = UIImage(named: "PlaceholderImage")
let imageUrl: URL(string: "https://avatars2.githubusercontent.com/u/1340892?v=3&s=200")
let imageUrl = URL(string: "https://avatars2.githubusercontent.com/u/1340892?v=3&s=200")

imageView.setImage(url: imageUrl, placeholder: placeholder)
```

### Use callback for when the image is set to the image view
```swift
let imageView: UIImageView()
let imageUrl: URL(string: "https://avatars2.githubusercontent.com/u/1340892?v=3&s=200")
let imageView = UIImageView()
let imageUrl = URL(string: "https://avatars2.githubusercontent.com/u/1340892?v=3&s=200")

imageView.setImage(url: imageUrl) { image in
/// This closure gets called when the image is set to the image view.
Expand All @@ -60,8 +60,8 @@ imageView.setImage(url: imageUrl) { image in
it's being cached and displayed on the screen.

```swift
let imageView: UIImageView()
let imageUrl: URL(string: "https://avatars2.githubusercontent.com/u/1340892?v=3&s=200")
let imageView = UIImageView()
let imageUrl = URL(string: "https://avatars2.githubusercontent.com/u/1340892?v=3&s=200")

imageView.setImage(url: imageUrl, preprocess: { image in
/// Apply pre-process here ...
Expand Down

0 comments on commit e6fe08f

Please sign in to comment.