Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🌹 Updated readme examples to correct syntax. #43

Merged
merged 1 commit into from
Mar 31, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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