Post

Replies

Boosts

Views

Activity

Comment on How to preview a custom View that takes bindings as inputs in its initializer?
I used this today, more than 4 years after the original question. The way I did it with Swift 5 (a bit cleaner) is: #Preview { struct BindingViewExamplePreviewContainer_2 : View { @State private var value = false var body: some View { BindingViewExample_2(value: $value) } } return BindingViewExamplePreviewContainer_2() }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Mar ’24