Skip to content

Commit c4de1a1

Browse files
authored
Merge pull request #33 from Jake-Short/close-button-updates
Changed closeButtonAlignment from optional to required value (+ minor updates)
2 parents 2119eec + 4ec0d26 commit c4de1a1

File tree

3 files changed

+3
-21
lines changed

3 files changed

+3
-21
lines changed

Package.resolved

-16
This file was deleted.

Sources/ImageViewer/ImageViewer.swift

+2-4
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public struct ImageViewer: View {
1414
@State var dragOffset: CGSize = CGSize.zero
1515
@State var dragOffsetPredicted: CGSize = CGSize.zero
1616

17-
public init(image: Image, viewerShown: Binding<Bool>, aspectRatio: Binding<CGFloat>? = nil, caption: Text? = nil, closeButtonAlignment: CloseButtonAlignment?) {
17+
public init(image: Image, viewerShown: Binding<Bool>, aspectRatio: Binding<CGFloat>? = nil, caption: Text? = nil, closeButtonAlignment: CloseButtonAlignment? = .topLeft) {
1818
self.image = image
1919
self.imageOpt = nil
2020

@@ -24,7 +24,7 @@ public struct ImageViewer: View {
2424
self.closeButtonAlignment = closeButtonAlignment
2525
}
2626

27-
public init(image: Image?, viewerShown: Binding<Bool>, aspectRatio: Binding<CGFloat>? = nil, caption: Text? = nil, closeButtonAlignment: CloseButtonAlignment?) {
27+
public init(image: Image?, viewerShown: Binding<Bool>, aspectRatio: Binding<CGFloat>? = nil, caption: Text? = nil, closeButtonAlignment: CloseButtonAlignment? = .topLeft) {
2828
self.image = Image(systemName: "")
2929
self.imageOpt = image
3030

@@ -150,7 +150,6 @@ public struct ImageViewer: View {
150150

151151

152152
public class PinchZoomView: UIView {
153-
154153
weak var delegate: PinchZoomViewDelgate?
155154

156155
private(set) var scale: CGFloat = 0 {
@@ -239,7 +238,6 @@ public protocol PinchZoomViewDelgate: AnyObject {
239238
}
240239

241240
struct PinchZoom: UIViewRepresentable {
242-
243241
@Binding var scale: CGFloat
244242
@Binding var anchor: UnitPoint
245243
@Binding var offset: CGSize

Sources/ImageViewerRemote/ImageViewerRemote.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public struct ImageViewerRemote: View {
1919

2020
@ObservedObject var loader: ImageLoader
2121

22-
public init(imageURL: String, viewerShown: Binding<Bool>, aspectRatio: Binding<CGFloat>? = nil, disableCache: Bool? = nil, caption: Text? = nil, closeButtonAlignment: CloseButtonAlignment?) {
22+
public init(imageURL: String, viewerShown: Binding<Bool>, aspectRatio: Binding<CGFloat>? = nil, disableCache: Bool? = nil, caption: Text? = nil, closeButtonAlignment: CloseButtonAlignment? = .topLeft) {
2323
self.imageURL = imageURL
2424
_viewerShown = viewerShown
2525
self.disableCache = disableCache

0 commit comments

Comments
 (0)