Having trouble figuring out how to make the following call in swift:
var anyError: NSError? = nil
var rsrc: NSNumber? = nil
var success = url.getResourceValue(&a
If the getResourceValue(:forKey:) result is ultimately a logical value, you can cast the returned pointer value directly to a Bool value:
let boolResult = rsrc as! Bool
or simply test it as a Bool value without assigning it:
if rsrc as! Bool {
// true code
} else {
// false code
}
or do both:
if let rsrc as! Bool {
// true
} else {
// false
}