So far I have this code:
var thumbnailErr: NSError?
var thumbnailDictionary: AutoreleasingUnsafeMutablePointer<AnyObject?> = nil
let getItemSucceeded = url.getPromisedItemResourceValue(thumbnailDictionary, forKey: NSURLThumbnailDictionaryKey, error: &thumbnailErr)
if getItemSucceeded {
}
Now I want to turn thumbnailDictionary into a Dictionary or NSDictionary. This is how I do it in Objective-C:
BOOL thumbnailSucceeded = [urlFromPath getPromisedItemResourceValue:thumbnailDictionary forKey:NSURLThumbnailDictionaryKey error:&thumbnailErr];
if (thumbnailSucceeded) {
NSDictionary *dict = (__bridge NSDictionary *)(void *)thumbnailDictionary;
}
I cannot for the life of me figure out how to do this in Swift. Help?
Got it. Passing in an AutoreleasingUnsafeMutablePointer wasn't necessary.
var thumbnailErr: NSError?
var thumbnailDictionary: AnyObject?
let getItemSucceeded = url.getPromisedItemResourceValue(&thumbnailDictionary, forKey: NSURLThumbnailDictionaryKey, error: &thumbnailErr)
if getItemSucceeded {
let dict = thumbnailDictionary as NSDictionary
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With