您好使用AWS移动中心在iOS我跟随介绍aut与认证。它说我必须从示例中导入用户池文件。我这样做了,但是,这将引发我一个错误:AWS iOS Swift 3 Cognito类型不符合协议
extension SignInViewController: AWSCognitoIdentityPasswordAuthentication {
func getDetails(_ authenticationInput: AWSCognitoIdentityPasswordAuthenticationInput, passwordAuthenticationCompletionSource: AWSTaskCompletionSource<AnyObject>) {
self.passwordAuthenticationCompletion = passwordAuthenticationCompletionSource
}
func didCompleteStepWithError(_ error: Error?) {
if let error = error {
DispatchQueue.main.async(execute: {
UIAlertView(title: "ERROR",
message: error.localizedDescription,
delegate: nil,
cancelButtonTitle: "Ok").show()
})
}
}
}
错误:
Type 'SignInViewController' does not conform to protocol 'AWSCognitoIdentityPasswordAuthentication'
另外:
Protocol requires function 'getDetails(_:passwordAuthenticationCompletionSource:)' with type '(AWSCognitoIdentityPasswordAuthenticationInput, AWSTaskCompletionSource) -> Void'; do you want to add a stub? (AWSCognitoIdentityProvider.AWSCognitoIdentityPasswordAuthentication)
和:
Candidate has non-matching type '(AWSCognitoIdentityPasswordAuthenticationInput, AWSTaskCompletionSource) ->()'
它们实现了,只是在Swift 3中重命名 –
我参与了并添加了更多的错误信息 –