Saving to Core Data during device locking & unlocking

The following error message

"SIGABRT: This NSPersistentStoreCoordinator has no persistent stores (device locked). It cannot perform a save operation"

has indicated need to provide for sequencing of the Core Data context saving operation.

We want to avoid .save() if locking is in flight, also postpone .save() until unlocking has completed.

Currently our .save() is bracket by do-catch block but this is notably not helping in the case of SIGABR signal

Given that our saving operations must take place synchronously, what is the recommended practice to implement such sequencing with respect to locking / unlocking

Saving to Core Data during device locking & unlocking
 
 
Q