【发布时间】:2016-12-27 00:25:40
【问题描述】:
我在 ios 应用程序中使用 Amazon Cognito 和 Facebook 登录。在 beta 5 之前,此代码 from this SO thread 有效:
class CustomIdentityProvider: NSObject, AWSIdentityProviderManager {
var tokens: [NSString: NSString]?
init(tokens: [NSString: NSString]) {
self.tokens = tokens
}
@objc func logins() -> AWSTask<NSDictionary> {
return AWSTask(result: tokens) // Compile error in beta 6
}
}
在 beta 6 中我得到这个编译错误:
Cannot convert value of type '[NSString:NSString]?' to expected argument type '_?'
当我把线改为
return AWSTask(result: tokens! as [AnyObject: AnyObject])
我得到了错误
Type 'AnyObject' does not conform to protocol 'Hashable'
这是快速版本。 3.
【问题讨论】:
标签: ios swift amazon-web-services beta xcode8-beta6