Repository navigation
Adding PreviewTrait support for SwiftUI previews #374
alexanderwe
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi everyone,
I was working with Factory in SwiftUI previews and was always registering the dependencies that I need in my Previews in their body. While it works it didn't felt idiomatic to do so from a callers perspective. Therefore I was looking into PreviewTraits and came up with the following implementation:
Usage:
I would like to gather some feedback if you think something like this would make sense to be part of the library or if its too narrow since its just a SwiftUI specific implementation and rather consumers should write similar extensions like this themselves.
Happy to hear your feedback
All reactions