[英]Unable to compile AWS CustomIdentityProvider on xcode 8 beta 6
I am using Amazon Cognito and Facebook login in an ios app. 我在ios应用程序中使用Amazon Cognito和Facebook登录。 Up until beta 5 this code from this SO thread worked:
直到beta 5为止,此SO线程中的此代码都有效:
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
}
}
In beta 6 I get this compile error: 在beta 6中,我得到此编译错误:
Cannot convert value of type '[NSString:NSString]?' to expected argument type '_?'
When I change the line to 当我将行更改为
return AWSTask(result: tokens! as [AnyObject: AnyObject])
I get the error 我得到错误
Type 'AnyObject' does not conform to protocol 'Hashable'
This is swift ver. 这是很快的版本。 3.
3。
强制转换为NSDictionary而不是Swift字典:
return AWSTask(result: tokens! as NSDictionary)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.