File tree 1 file changed +24
-0
lines changed
1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ A-J-Full-Screen-Image-Browser is an drop-in solution for full screen image and v
19
19
- [x] Double tap to zoom all the way in and again to zoom all the way out
20
20
- [x] Swipe to dismiss
21
21
- [x] High level diagram
22
+ - [x] MVVM architecture
22
23
- [x] Easy to customise
23
24
24
25
## Requirements
@@ -31,6 +32,29 @@ A-J-Full-Screen-Image-Browser is an drop-in solution for full screen image and v
31
32
32
33
- drag and drop the entire ` A_J_Full_Screen_Image_Browser ` into your project
33
34
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
+
34
58
## Demo
35
59
36
60
< p align= " center" >
You can’t perform that action at this time.
0 commit comments