Skip to content

Instantly share code, notes, and snippets.

View AlexandreFenyo's full-sized avatar

Alexandre Fenyo AlexandreFenyo

View GitHub Profile
@ricardo0100
ricardo0100 / PhotoView.swift
Created August 15, 2020 15:20
Photo View with zoom and edges control in SwiftUI
import SwiftUI
struct PhotoView: View {
@State var scale: CGFloat = 1
@State var scaleAnchor: UnitPoint = .center
@State var lastScale: CGFloat = 1
@State var offset: CGSize = .zero
@State var lastOffset: CGSize = .zero
@State var debug = ""