Skip to content

Commit 2507886

Browse files
author
Alex Jiang
committed
[misc](repo): update repo asset
1 parent 6c87825 commit 2507886

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

README.md

+24
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ A-J-Full-Screen-Image-Browser is an drop-in solution for full screen image and v
1919
- [x] Double tap to zoom all the way in and again to zoom all the way out
2020
- [x] Swipe to dismiss
2121
- [x] High level diagram
22+
- [x] MVVM architecture
2223
- [x] Easy to customise
2324

2425
## Requirements
@@ -31,6 +32,29 @@ A-J-Full-Screen-Image-Browser is an drop-in solution for full screen image and v
3132

3233
- drag and drop the entire `A_J_Full_Screen_Image_Browser` into your project
3334

35+
## Full Usage Example
36+
37+
```swift
38+
import UIKit
39+
40+
final class ViewController: UIViewController {
41+
42+
lazy var images: [ImageAsyncDownloadable] = {
43+
return [SingleImage(imageURL: URL(string: "https://images.unsplash.com/photo-1445264918150-66a2371142a2?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=79730c9ec106e3ccee026c648c624e5f&auto=format&fit=crop&w=3800&q=80")!),
44+
SingleImage(imageURL: URL(string: "https://images.unsplash.com/photo-1483086431886-3590a88317fe?ixlib=rb-0.3.5&s=96129ab02a4a277f5c27273d14323a9a&auto=format&fit=crop&w=3668&q=80")!)]
45+
}()
46+
47+
lazy var urls = [URL(string: "https://images.unsplash.com/photo-1502899576159-f224dc2349fa?ixlib=rb-0.3.5&s=4f3943a5d663f9bb062d7d380c8d6fdf&auto=format&fit=crop&w=3700&q=80")!,
48+
URL(string: "https://images.unsplash.com/photo-1445264918150-66a2371142a2?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=79730c9ec106e3ccee026c648c624e5f&auto=format&fit=crop&w=3800&q=80")!]
49+
50+
@IBAction func onButtonTapped(_ sender: UIButton) {
51+
let vm = FullScreenImageBrowserViewModel(urls: urls)
52+
let x = FullScreenImageBrowser(viewModel: vm)
53+
present(x, animated: true, completion: nil)
54+
}
55+
```
56+
57+
3458
## Demo
3559

3660
<p align="center">

0 commit comments

Comments
 (0)