Last active
March 22, 2024 11:46
-
-
Save Volorf/81ae055938d72e903beb572fedf45bbf to your computer and use it in GitHub Desktop.
Text Animation.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
import PlaygroundSupport | |
struct MyExperimentalView: View | |
{ | |
@State private var count: Int = 10 | |
var body: some View | |
{ | |
Text("Count: \(count)") | |
.onTapGesture(count: 1) | |
{ | |
count -= 1 | |
print(count) | |
} | |
.contentTransition(.numericText(value: Double(count))) | |
.animation(.bouncy, value: count) | |
} | |
} | |
let view = MyExperimentalView() | |
PlaygroundPage.current.setLiveView(view) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment