-
Notifications
You must be signed in to change notification settings - Fork 3
/
ContentView.swift
41 lines (34 loc) · 1000 Bytes
/
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
//
// ContentView.swift
// P06B Animations
//
// Created by Julian Moorhouse on 12/12/2020.
// Copyright © 2020 Mindwarp Consultancy Ltd. All rights reserved.
//
import SwiftUI
struct ContentView: View {
@State private var animationAmount: CGFloat = 1
var body: some View {
print(animationAmount)
return VStack {
Stepper("Scale amount", value: $animationAmount.animation(
Animation.easeInOut(duration: 1)
.repeatCount(3, autoreverses: true)
), in: 1...10)
Spacer()
Button("Tap me") {
self.animationAmount += 1
}
.padding(40)
.background(Color.red)
.foregroundColor(.white)
.clipShape(Circle())
.scaleEffect(animationAmount)
}
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}