Data to different types ?

Is there documentation for converting Data to any specific Type ?


I’m trying to get & set Date Last Opened and came across a nice extension someone posted for getting & settings Extra Attributes  … it’s the first response. Found the attribute “” which comes back as Data. I tried searching Google but again didn’t find much, just examples of turning Data into Strings. Would be nice to have a single document for any type ?


I have no idea if this relates to the same thing but at the moment am using “NSMetadataItem(url: url)?.value(forAttribute: NSMetadataItemLastUsedDateKey) as? Date” which works fine although not sure about setting the attribute.

Powered by WPeMatico

You may also like...

Comments are closed.