5
Tôi đang sử dụng đăng nhập Amazon Cognito và Facebook trong ứng dụng ios. Cho đến phiên bản beta 5 mã này from this SO thread làm việc:Không thể biên dịch AWS CustomIdentityProvider trên xcode 8 beta 6
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
}
}
Trong beta 6 Tôi nhận được lỗi biên dịch này:
Cannot convert value of type '[NSString:NSString]?' to expected argument type '_?'
Khi tôi thay đổi dòng để
return AWSTask(result: tokens! as [AnyObject: AnyObject])
tôi nhận được lỗi
Type 'AnyObject' does not conform to protocol 'Hashable'
Đây là ver nhanh chóng. 3.
Cảm ơn bạn. :-) Đó là khá rõ ràng. – kometen