Provide options for users to delete their CloudKit data from your app.
If your app stores data in CloudKit on behalf of your users, give them a simple way to delete their data.
To be sure that you're deleting all of a user's data stored by your app in CloudKit, cross-reference the list of containers your app has access to in Xcode and assemble a list of those containers' identifiers. This process is described in Identifying an App's Containers.
The example below stores containers in an array used later for enumeration.