Created
February 16, 2022 12:32
-
-
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
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 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