Читая код Apple, я видел следующее (говоря о сервисах Keychain):
query[kSecAttrService as String] = service as AnyObject?
Какова цель AnyObject?
?
Я думаю, что это можно упростить как
query[kSecAttrService as String] = service as AnyObject
Любая подсказка?
Это весь фрагмент из образца Apple:
private static func keychainQuery(withService service: String, account: String? = nil, accessGroup: String? = nil) -> [String : AnyObject] {
var query = [String : AnyObject]()
query[kSecClass as String] = kSecClassGenericPassword
query[kSecAttrService as String] = service as AnyObject?
if let account = account {
query[kSecAttrAccount as String] = account as AnyObject?
}
if let accessGroup = accessGroup {
query[kSecAttrAccessGroup as String] = accessGroup as AnyObject?
}
return query
}