Post

Replies

Boosts

Views

Activity

SwiftUI Preview Sheet w/o Running Live Preview?
(Cross post from: Stack Overflow - https://stackoverflow.com/questions/64096402/swiftui-preview-sheet-w-o-running-live-preview) Is it possible to create a SwiftUI preview of a presented sheet without running the Live Preview? For example: struct Sheet_Previews: PreviewProvider { static var previews: some View { Text("Background").sheet(isPresented: .constant(true)) { Text("Sheet") } } } The above results in the following preview: (See image 1 on Stack Overflow - https://stackoverflow.com/questions/64096402/swiftui-preview-sheet-w-o-running-live-preview) In order for the sheet content to be presented in the preview, you must run the Live Preview: (See image 2 on Stack Overflow - https://stackoverflow.com/questions/64096402/swiftui-preview-sheet-w-o-running-live-preview)
2
0
3.1k
Jul ’23