Last active
October 23, 2022 22:58
-
-
Save Edudjr/94d6f414fa9536c57ea37c6716b4e7a5 to your computer and use it in GitHub Desktop.
This file contains 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
Text("Testing") | |
.scaleEffect(firstAnimation ? 2 : 1) | |
.foregroundColor(secondAnimation ? .red : .green) | |
.onTapGesture { | |
let animationTime = 0.5 | |
withAnimation(.linear(duration: animationTime)) { | |
firstAnimation = true | |
} | |
withAnimation(.linear(duration: animationTime).delay(animationTime)) { | |
secondAnimation = true | |
} | |
let totalAnimationTime = animationTime * 2 | |
DispatchQueue.main.asyncAfter(deadline: .now() + totalAnimationTime) { | |
displaySheet = true | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment