Created
October 23, 2022 18:44
-
-
Save Edudjr/5a4b7f5d973fb745bd8bd6142eed3ebd 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
struct AnimationSample: View { | |
@State var firstAnimation = false | |
@State var secondAnimation = false | |
var body: some View { | |
Text("Testing") | |
.scaleEffect(firstAnimation ? 2 : 1) | |
.foregroundColor(secondAnimation ? .red : .green) | |
.onTapGesture { | |
withAnimation(.linear(duration: 0.5)) { | |
firstAnimation = true | |
} | |
withAnimation(.linear(duration: 0.5).delay(0.5)) { | |
secondAnimation = true | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment