-
Notifications
You must be signed in to change notification settings - Fork 3
/
ContentView.swift
52 lines (48 loc) · 1.35 KB
/
ContentView.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//
// ContentView.swift
// P17 Flashzilla
//
// Created by Julian Moorhouse on 06/05/2021.
//
import SwiftUI
struct ContentView: View {
@State private var currentAmount: CGFloat = 0
@State private var finalAmount: CGFloat = 1
var body: some View {
Text("Hello, world!")
// .onTapGesture(count: 2) {
// print("Double tapped!")
// }
//--
// .onLongPressGesture {
// print("Long pressed!")
// }
//--
// .onLongPressGesture(minimumDuration: 2) {
// print("Long pressed!")
// }
//--
// .onLongPressGesture(minimumDuration: 2, pressing: { inProgress in
// print("In progress: \(inProgress)")
// }) {
// print("Long pressed!")
// }
//--
.scaleEffect(finalAmount + currentAmount)
.gesture(
MagnificationGesture()
.onChanged { amount in
self.currentAmount = amount - 1
}
.onEnded { amount in
self.finalAmount += self.currentAmount
self.currentAmount = 0
}
)
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}