-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathModalImageView.swift
49 lines (41 loc) · 1.17 KB
/
ModalImageView.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//
// ModalImageView.swift
// PicturesViewer
//
// Created by Bryan Zec on 24/03/2022.
//
import SwiftUI
struct ModalImageView: View {
@Environment(\.presentationMode) var presentationMode
var image: UIImage
var body: some View {
ZStack {
ZoomableScrollView {
Image(uiImage: image)
.resizable()
.aspectRatio(contentMode: .fit)
}
VStack {
Spacer()
HStack {
Button(action: {
presentationMode.wrappedValue.dismiss()
}) {
Image(systemName: "arrow.down")
.frame(width: 35, height: 35)
}
.tint(.blue)
.buttonStyle(.borderedProminent)
.buttonBorderShape(.roundedRectangle(radius: 25))
Spacer()
}.padding()
}
}
}
}
struct ModalImageView_Previews: PreviewProvider {
static var img: UIImage = UIImage(named: "image")!
static var previews: some View {
ModalImageView(image: img)
}
}