Created
April 1, 2022 01:51
-
-
Save lando2319/7ebfdefaefd6bc590b24eedce5b80bdb to your computer and use it in GitHub Desktop.
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
| struct HopBetsView: View { | |
| @ObservedObject var localGameManager: GameManagerPro | |
| @State var namespaceShowoff = false | |
| @Namespace var showoff | |
| var body: some View { | |
| GeometryReader { metrics in | |
| ... | |
| HStack(alignment: .center, spacing: .zero, content: { | |
| if namespaceShowoff { | |
| Image("puckOff") | |
| .matchedGeometryEffect(id: "showOff", in: showoff) | |
| } | |
| Spacer() | |
| if !namespaceShowoff { | |
| Image("puckOff") | |
| .matchedGeometryEffect(id: "showOff", in: showoff) | |
| } | |
| }) | |
| Button("FLIP", action: { | |
| withAnimation(.spring(), { | |
| namespaceShowoff.toggle() | |
| }) | |
| }) | |
| ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment