Skip to content

Instantly share code, notes, and snippets.

@lando2319
Created April 1, 2022 01:51
Show Gist options
  • Select an option

  • Save lando2319/7ebfdefaefd6bc590b24eedce5b80bdb to your computer and use it in GitHub Desktop.

Select an option

Save lando2319/7ebfdefaefd6bc590b24eedce5b80bdb to your computer and use it in GitHub Desktop.
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