In previous versions of Xcode 6 and 7 with Swift, this syntax would work:
var secureItemValue: Unmanaged?
let statusCode: OSStatus = Se
This works on Xcode 7 beta 4
var dataTypeRef: AnyObject?
let status: OSStatus = withUnsafeMutablePointer(&dataTypeRef) { SecItemCopyMatching(keychainQuery as CFDictionaryRef, UnsafeMutablePointer($0)) }
if status == noErr {
return dataTypeRef as? NSData
}
else {
return nil
}
According to this answer you can just remove Unmanaged<>
around AnyObject:
var secureItemValue: AnyObject?
let statusCode: OSStatus = SecItemCopyMatching(keychainItemQuery, &secureItemValue)