Skip to content

Instantly share code, notes, and snippets.

@ChrisMash
Created February 16, 2022 12:32
Show Gist options
  • Select an option

  • Save ChrisMash/af60e8b99ebf5eb4c41abb7e3f91093b to your computer and use it in GitHub Desktop.

Select an option

Save ChrisMash/af60e8b99ebf5eb4c41abb7e3f91093b to your computer and use it in GitHub Desktop.
Snapshot of CardView_Preview from https://github.com/ChrisMash/SwiftUI-Playing-Cards for my blog
struct CardView_Previews: PreviewProvider {
// Create a wrapper view that will let us hold a @Namespace to pass to the view
struct Wrapper: View {
@Namespace var animation
var body: some View {
CardView(card: Card(number: 1), namespace: animation)
.padding()
.background(Color.gray)
}
}
static var previews: some View {
Wrapper()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment