Issue:
When choosing a document from iCloud the application randomly crashes, for most of the time the following code will work, but on rare occasions it will fail.
I recently stumpled opon the same problem:
*** Assertion failure in -[UIDocumentPickerViewController _commonInitWithCompletion:]
is caused due to lacking App-Capabilities. Go to your Build and choose Capabilities -> iCloud
Activate it via the switch on the right hand side and toggle iCloud Documents and CloudKit ON. (Notice: This will only work with a payed developer account)
Rebuild->Run
Also have in mind:
iCloud entitlements are available only to apps submitted to the App Store or to the Mac App Store. (Source)