Hello!
I have a simple app that opens a sheet and when you press a button on the sheet it will open a quick look preview of a picture. That works great but when I exit the quick look preview it will close the sheet too. This seems like unexpected behavior because it doesn't happen on iOS.
Any help is appreciated, thank you.
Here is some simple repo:
import QuickLook
import SwiftUI
struct ContentView: View {
@State private var pictureURL: URL?
@State private var openSheet = false
var body: some View {
Button("Open Sheet") {
openSheet = true
}
.sheet(isPresented: $openSheet) {
Button("Open Picture") {
pictureURL = URL(fileURLWithPath: "someImagePath")
}
// When quick look closes it will close the sheet too.
.quickLookPreview($pictureURL)
}
}
}
And here is a quick video: