Skip to content

Commit 24699fb

Browse files
authored
Update README with 2.0.0 changes
1 parent df8b647 commit 24699fb

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

README.md

+16-15
Original file line numberDiff line numberDiff line change
@@ -65,58 +65,59 @@ struct ContentView: View {
6565

6666
# Customization
6767

68-
### HTTP Headers
68+
### Explicit Aspect Ratio
6969

70-
#### Availability: 1.0.15 or higher
70+
#### Availability: 1.0.21 or higher
7171

72-
The remote image viewer allows HTTP headers to be included in the URL request. To use them, pass a dictonary to the httpHeaders field. The format should be [Header: Value], both strings.
72+
An explcit image aspect ratio can be specified, which fixes an issue of incorrect stretching that occurs in certain situations. The `aspectRatio` parameter accepts `Binding<CGFloat>`
7373

7474
Example:
7575
```Swift
76-
import ImageViewerRemote
76+
import ImageViewer
7777

7878
struct ContentView: View {
7979
@State var showImageViewer: Bool = true
80+
@State var image = Image("example-image")
8081

8182
var body: some View {
8283
VStack {
8384
Text("Example!")
8485
}
8586
.frame(maxWidth: .infinity, maxHeight: .infinity)
86-
.overlay(ImageViewerRemote(imageURL: URL(string: "https://..."), viewerShown: self.$showImageViewer, httpHeaders: ["X-Powered-By": "Swift!"]))
87+
.overlay(ImageViewer(image: self.$image, viewerShown: self.$showImageViewer, aspectRatio: .constant(2)))
8788
}
8889
}
8990
```
9091

91-
### Explicit Aspect Ratio
92+
### Disable Cache
9293

93-
#### Availability: 1.0.21 or higher
94+
#### Availability: 1.0.25 or higher
9495

95-
An explcit image aspect ratio can be specified, which fixes an issue of incorrect stretching that occurs in certain situations. The `aspectRatio` parameter accepts `Binding<CGFloat>`
96+
To disable cache on the remote image viewer, simply pass a `Bool` value to the `disableCache` parameter
9697

9798
Example:
9899
```Swift
99-
import ImageViewer
100+
import ImageViewerRemote
100101

101102
struct ContentView: View {
102103
@State var showImageViewer: Bool = true
103-
@State var image = Image("example-image")
104104

105105
var body: some View {
106106
VStack {
107107
Text("Example!")
108108
}
109109
.frame(maxWidth: .infinity, maxHeight: .infinity)
110-
.overlay(ImageViewer(image: self.$image, viewerShown: self.$showImageViewer, aspectRatio: .constant(2)))
110+
.overlay(ImageViewerRemote(imageURL: URL(string: "https://..."), viewerShown: self.$showImageViewer, disableCache: true))
111111
}
112112
}
113113
```
114114

115-
### Disable Cache
115+
### HTTP Headers
116116

117-
#### Availability: 1.0.25 or higher
117+
#### Availability: 1.0.15 to 1.0.25
118+
#### *DEPRECATED*: No longer available as of 2.0.0
118119

119-
To disable cache on the remote image viewer, simply pass a `Bool` value to the `disableCache` parameter
120+
The remote image viewer allows HTTP headers to be included in the URL request. To use them, pass a dictonary to the httpHeaders field. The format should be [Header: Value], both strings.
120121

121122
Example:
122123
```Swift
@@ -130,7 +131,7 @@ struct ContentView: View {
130131
Text("Example!")
131132
}
132133
.frame(maxWidth: .infinity, maxHeight: .infinity)
133-
.overlay(ImageViewerRemote(imageURL: URL(string: "https://..."), viewerShown: self.$showImageViewer, disableCache: true))
134+
.overlay(ImageViewerRemote(imageURL: URL(string: "https://..."), viewerShown: self.$showImageViewer, httpHeaders: ["X-Powered-By": "Swift!"]))
134135
}
135136
}
136137
```

0 commit comments

Comments
 (0)