Accessing Core Data from the app and from a today widget

I am developing an app that has a today widget extension.


The widget should have read and write access to Core Data. Therefor I want to store all Core Data relevant files in an app group container.


The app itself should also be able to read and write to Core Data. Inside the app I will use 3 Core Data contexts:

private Context: writes data to the file and is connected to a PSC

V parent

main Context: interacts with the UI (read only access)

V parent

private Context: downloads data from a server (read/write access)


Is it save to access the sqlite- and model-file directly from the extension in the same way the app does (with 3 contexts)?


Thanks in advance!

Accessing Core Data from the app and from a today widget
 
 
Q