Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
nnsnodnb committed Aug 19, 2021
1 parent f0ef608 commit 07aa917
Showing 1 changed file with 32 additions and 2 deletions.
34 changes: 32 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,39 @@ let package = Package(
)
```
## Example
## Usage
Please see Example project.
```swift
import MultipleImageView
final class SomeView: UIView, MultipleImageViewDelegate {
func configure() {
let imageView = MultipleImageView(frame: .zero)
addSubview(imageView)
// Autolayout
imageView.sources = [
.uiimage(anyImage),
.url(anyURL),
.custom { imageView in
// something fetch image
imageView.image = image
}
]
imageView.delegate = self
}
// MARK: - MultipleImageViewDelegate
func multipleImageViewShouldGetImage(_ imageView: UIImageView, sourceForURL url: URL, index: Int) {
// Your project's image fetch & cache algorithm.
}
func multipleImageViewDidSelect(_ imageView: UIImageView, index: Int) {
}
}
```
And please see Example project.
## License
Expand Down

0 comments on commit 07aa917

Please sign in to comment.