Skip to content

Connection error when running on Mac in ‘Designed for iPad’ mode #65

Answered by groue
matiaskorhonen asked this question in Q&A
Discussion options

You must be logged in to vote

It looks like something weird happens with sheets and full-screen covers in the iPad compatibility mode.

This reminds me of early SwiftUI, where sheets would not inherit environment values.

Did you try to re-inject the environment in sheets?

 struct MyView: View {
+  @Environment(\.databaseContext) var databaseContext
   var body: some View {
     ContentView().sheet(...) {
       MySheet()
+        .databaseContext(databaseContext)
     }
   }
 }

If this works, it would be a good idea to submit a feedback to Apple.

I added what you suggested to the view where I'm having issues, and it reports ‘Success’ despite the queries still failing.

This does not make sense, unless the queries fe…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@matiaskorhonen
Comment options

@groue
Comment options

groue Mar 5, 2025
Maintainer

Answer selected by matiaskorhonen
@matiaskorhonen
Comment options

@groue
Comment options

groue Mar 5, 2025
Maintainer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants