Question:
i try to adopt answer from How to re-use the same FetchRequest, rather than the same request in several views?i build simple app with Core data
thanks for help in advance
Answer:
.loadCounts()
is applied as a modifier outside (after) the modifier that sets the managed object context in the environment. This means the environment value is not present in your modifier’s body. Try moving .loadCounts()
above .environment(\.managedObjectContext, ...)
.If you have better answer, please add a comment about this, thank you!