Is the Encodable/Decodable system safe for asynchronous NSDocument handling?

I was just reading up on AppKit again and saw that the NSDocument system allows asynchronous loading and saving. If I use a Codable type for my model data, is the data translation safe to use in the background? How much does it depend on the model type’s code and the en/de-coder used? Do any of the default coders have hidden shared state that prevents this?

IIRC, the coding process itself doesn't mutate the top-level coders, so you can probably share them just fine. I'd go extra mile to create a separate coder, just to be sure.

Terms of Service

Privacy Policy

Cookie Policy