In order to share documents from a user's iCloud library, you need to add the iCloud entitlement to the application capabilities, as follows:
- Turn iCloud to ON, and select the iCloud Documents service.
- Create an iCloud container by going to the Apple Developer Certs, profiles and IDs page, and add iCloud permission to your app ID.
- If Xcode does not automatically manage your provisioning profiles, you need to update and re‑download the correct provisioning profile for your app.
Note: If you do not wish to give access to iCloud documents for document sharing, you need to do nothing to customize the provisioning profile.