Here are all the thumbnail keys :
static let thumbnailKey: URLResourceKey
All thumbnails as a single NSImage (read-write).
static let thumbnailDictionaryKey: URLResourceKey
A dictionary of NSImage/UIImage objects keyed by size (read-write).
See URLThumbnailDictionaryItem for a list of possible keys.
static let NSThumbnail1024x1024SizeKey: URLThumbnailDictionaryItem
Possible keys for the thumbnailDictionaryKey dictionary.
So, the key exists.
Did you try to covert to FileAttributeKey
URLResourceKey.thumbnailDictionaryKey: [ FileAttributeKey(URLThumbnailDictionaryItem.NSThumbnail1024x1024SizeKey.rawValue): image ]
Direct cast as FileAttributeKey does not work.
The answer of Claud31 is very suggesting, but you may need something like this:
return [ FileAttributeKey(URLResourceKey.hasHiddenExtensionKey.rawValue): true, FileAttributeKey(URLResourceKey.thumbnailDictionaryKey.rawValue): [ URLThumbnailDictionaryItem.NSThumbnail1024x1024SizeKey: image ] ]
The outermost keys for the returned dictionary need to be of type `FileAttributeKey`.
The type `FileAttributeKey` is a thin wrapper for `NSString` and you can initialize it with a String value.
Thanks for the responses and sorry for the delay (I didn't get an email notification that anyone had replied even though the forum shows me following this topic). Claud31's is not enough but OOPer's reply does allow it to compile. I haven't tried it on a device yet as I'm waiting for beta 2 before updating my iPad.