This commit is contained in:
Ben Weeks
2023-01-06 00:16:48 +00:00
parent 61a451184b
commit 2d10d4592b
6 changed files with 255 additions and 32 deletions

View File

@@ -0,0 +1,33 @@
//
// MagnificationGestureView.swift
// damus
//
// Created by user232838 on 1/5/23.
//
import SwiftUI
struct MagnificationGestureView: View {
@GestureState var magnifyBy = 1.0
var magnification: some Gesture {
MagnificationGesture()
.updating($magnifyBy) { currentState, gestureState, transaction in
gestureState = currentState
}
}
var body: some View {
Circle()
.frame(width: 100, height: 100)
.scaleEffect(magnifyBy)
.gesture(magnification)
}
}
struct MagnificationGestureView_Previews: PreviewProvider {
static var previews: some View {
MagnificationGestureView()
}
}