CloudKit Sharing
<p>I am having trouble understanding some of the CloudKit sharing concepts and the WWDC 2016 "What's new in CloudKit" video doesn't appear to explain everything that is required to allow users to share and access shared records.</p>

<p>I have successfully created an app that allows the user to create and edit a record in their private database.
I have also been able to create a Share record and share this using the provided sharing UIController.  This can be successfully received and accepted by the participant user but I can't figure out how to query and display this shared record.  </p>

<p>The app creates a "MainZone" in the users private database and then creates a CKRecord in this "MainZone".  I then create and save a CKShare record and use this to display the UICloudSharingController. </p>

<p>How do I query the sharedDatabase in order to access this record ?  I have tried using the same query as is used in the privateDatabase but get the following error:</p>

<pre><code>"ShareDB can't be used to access local zone"
</code></pre>

<p>EDIT</p>

<p>I found the problem - I needed to process the accepted records in the AppDelegate.  Now they appear in the CloudKit dashboard but I am still unable to query them.  It seems I may need to fetch the sharedDatabase "MainZone" in order to query them.</p>