Skip to content

Instantly share code, notes, and snippets.

@Edudjr
Last active October 23, 2022 22:58
Show Gist options
  • Save Edudjr/94d6f414fa9536c57ea37c6716b4e7a5 to your computer and use it in GitHub Desktop.
Save Edudjr/94d6f414fa9536c57ea37c6716b4e7a5 to your computer and use it in GitHub Desktop.
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