title: Trying to create a thumbnail for a cloudkit share but
body: <p>iOS 11.x Swift 4.2</p>
  
  <p>Creating a cloudKit share and setting permissions on it. All looks good and it works, but for the thumbnail that I am getting the following error message which is beyond me. What is it saying?</p>
  
  <blockquote>
    <p>2018-10-10 11:04:14.422093+0200 n2k Memo[12256:5302161]
    [DocumentManager] Failed to associate thumbnails for picked URL
    file:///private/var/mobile/Library/Mobile%20Documents/com~apple~CloudDocs/Desktop/August2018/App/Icons/noun_Puzzle_787736.png
    with the Inbox copy
    file:///private/var/mobile/Containers/Data/Application/D13D04E1-8700-4B3E-AD0B-710D037B5253/tmp/ch.cqd.blah-Inbox/noun_Puzzle_787736.png:
    Error Domain=QLThumbnail Code=2 "(null)"
    UserInfo={NSUnderlyingError=0x1c444b070 {Error
    Domain=GSLibraryErrorDomain Code=3 "Generation not found"
    UserInfo={NSDescription=Generation not found}}}</p>
  </blockquote>
  
  <p>My code looks like this ...</p>
  
  <pre><code>let share = CKShare(rootRecord: customRecord)
  share[CKShare.SystemFieldKey.title] = "Marley" as CKRecordValue
  share[CKShare.SystemFieldKey.shareType] = "ch.cqd.blah" as CKRecordValue
  
  let imageData = image2Save.pngData()!
  let options = [
          kCGImageSourceCreateThumbnailWithTransform: true,
          kCGImageSourceCreateThumbnailFromImageAlways: true,
          kCGImageSourceThumbnailMaxPixelSize: 300] as CFDictionary
  let source = CGImageSourceCreateWithData(imageData as CFData, nil)!
  let imageReference = CGImageSourceCreateThumbnailAtIndex(source, 0, options)!
  let thumbnail = UIImage(cgImage: imageReference).pngData()
  share[CKShare.SystemFieldKey.thumbnailImageData] = thumbnail! as CKRecordValue
  </code></pre>
  
  <p>The image2Save is a valid UIImage that I subsequently display. Added code to show the thumbnail on screen. Thumbnail looks good.</p>