Skip to content

Commit

Permalink
Merge pull request #33 from Jake-Short/close-button-updates
Browse files Browse the repository at this point in the history
Changed closeButtonAlignment from optional to required value (+ minor updates)
  • Loading branch information
Jake-Short authored Jan 24, 2022
2 parents 2119eec + 4ec0d26 commit c4de1a1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 21 deletions.
16 changes: 0 additions & 16 deletions Package.resolved

This file was deleted.

6 changes: 2 additions & 4 deletions Sources/ImageViewer/ImageViewer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public struct ImageViewer: View {
@State var dragOffset: CGSize = CGSize.zero
@State var dragOffsetPredicted: CGSize = CGSize.zero

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

Expand All @@ -24,7 +24,7 @@ public struct ImageViewer: View {
self.closeButtonAlignment = closeButtonAlignment
}

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

Expand Down Expand Up @@ -150,7 +150,6 @@ public struct ImageViewer: View {


public class PinchZoomView: UIView {

weak var delegate: PinchZoomViewDelgate?

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

struct PinchZoom: UIViewRepresentable {

@Binding var scale: CGFloat
@Binding var anchor: UnitPoint
@Binding var offset: CGSize
Expand Down
2 changes: 1 addition & 1 deletion Sources/ImageViewerRemote/ImageViewerRemote.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public struct ImageViewerRemote: View {

@ObservedObject var loader: ImageLoader

public init(imageURL: String, viewerShown: Binding<Bool>, aspectRatio: Binding<CGFloat>? = nil, disableCache: Bool? = nil, caption: Text? = nil, closeButtonAlignment: CloseButtonAlignment?) {
public init(imageURL: String, viewerShown: Binding<Bool>, aspectRatio: Binding<CGFloat>? = nil, disableCache: Bool? = nil, caption: Text? = nil, closeButtonAlignment: CloseButtonAlignment? = .topLeft) {
self.imageURL = imageURL
_viewerShown = viewerShown
self.disableCache = disableCache
Expand Down

0 comments on commit c4de1a1

Please sign in to comment.