Ambiguous reference to member Swift 3

前端 未结 3 1631
囚心锁ツ
囚心锁ツ 2021-01-02 04:05

I am migrating my project from Swift 2.3 to Swift 3. And having difficulty as expected.

Here is a function which is being used for OAuth, using OAuthSwift. I have t

3条回答
  •  情深已故
    2021-01-02 04:22

    I got the same error Ambiguous reference to member with the same method on converting it from Swift 4 to Swift 5. Looks like the completion handler has been changed to support the new Result type. Changing the completing handler to below fixed the issue for me,

            oauthVarSwift.authorize( withCallbackURL: URL(string: "")!,
                                 scope: "", state:"", completionHandler: {  result in
                                    switch result {
                                    case .success(let credential, let response,  let parameters):
                                        print(credential.oauthToken)
    
                                    case .failure(let error):
                                     print(error)
                                    }
    
              })
    

提交回复
热议问题