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  … https://stackoverflow.com/questions/38343186/write-extend-file-attributes-swift-example it’s the first response. Found the attribute “com.apple.lastuseddate#PS” 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

About

You may also like...

Comments are closed.