I was able to query records from CloudKit, but the CKRecord objects I retrieved were not able to cast to CKShare. How else would I retrieve shares in CloudKit. The cloudkit.share record type is not queryable.
This post on stackoverflow has an answer that says to take the share property of the CKRecord object, but Apple's CloudKitShare sample project found here uses code that casts CKRecord objects to CKShare.