In the settings screen of iOS I can choose for iCloud Drive enabled apps the "Document Storage" setting (analog to Mobile Data, Camera access options). There it says "Store Documents & Data On" with two options for iCloud Drive or On My Phone meaning locally.
How can I access the selected option in my app?
My app is based on UIDocumentBrowser with enabled "Supports opening documents in place" and "Application supports iTunes file sharing". Some apps, like Apple Mail only support the "Copy to" option when pressing the Share button (in comparison to "Open in"). In this case I would like to copy the shared document to the respective directory in my app, so either locally, or to the app's iCloud Drive directory, depending on the user's choice from the General settings.
Right now I base the decision where to copy the document on a check if iCloud Drive is enabled. However it's possible that iCloud Drive is enabled, but the user selected storing on his iPhone (locally).
There are apps in the Store which are based on UIDocumentBrowser and support this. Especially when they offer a create new file function
Thanks!
iOS11, Xcode 10.1