Quick question, are you on iOS 18? Did it work in iOS 17?
I'm trying to figure out a similar issue that worked in iOS 17, but doesn't work in iOS 18 Beta 1 and Beta 2 (just updated today).
In a nutshell I have a parent and child view as part of a NavigationSplitView.
A parent view has a @Query for items, the item is passed to the child view, like in your case. In the child there is a method that performs an async task, which updates the item in the background using @ModelActor
This update was immediately refrelcted in the child view on iOS 17 but is not reflected in iOS 18. Only if I navigate to parent view and then re-open child I can see the changes.
Post
Replies
Boosts
Views
Activity
Trying to figure out if this is possible for a sharedModelContainer.
When creating a new empty multiplatform app with SwiftData, this code is automatically generated in the App.swift:
import SwiftUI
import SwiftData
@main
struct SwiftDataTestApp: App {
var sharedModelContainer: ModelContainer = {
let schema = Schema([
Item.self,
])
let modelConfiguration = ModelConfiguration(schema: schema, isStoredInMemoryOnly: false)
do {
return try ModelContainer(for: schema, configurations: [modelConfiguration])
} catch {
fatalError("Could not create ModelContainer: \(error)")
}
}()
var body: some Scene {
WindowGroup {
ContentView()
}
.modelContainer(sharedModelContainer)
}
}
Is there a way to set isUndoEnabled in this scenario? Doesn't look like ModelContainer(for: Schema...) supports it?
In your addSamples try explicitly saving context after inserting models: try? modelContext.save(), this should allow deleting immediately.
Here is an example, the toolbar items appear with delay in detail view.
Experiencing the same on iOS 17.2 beta 3, the delay with which .toolbar appears is very noticeable
I found that Unable to parse manifest.json at file is thrown if manifest_version is not 2
Latest Chrome extensions use manifest version 3 and looks like Xcode can't handle it.
Have you installed the profile correctly?