My app has a custom Document type and create, edit, and save the Documents with custom extension. For saving I serialize the document and write Data
to a file URL. For retrieving I use FileManager
methods.
I want to save a custom value with File which I don't know how to do. I want to keep the File status as editing
or done
. When user create a new Document it's default status should be editing
and he can make the file as done
manually inside the app. I don't allow to edit done
files , user can only view them.
Can I use appendOnly: FileAttributeKey
for this purpose, assuming to make the file read-only if user marks it as done?
I also found this answer about extend file attributes Write extend file attributes swift example. Is this a recommended way by Apple? If above attribute cannot help I guess I'll have to use extended file attributes.. please advice
Thanks in advance