"모호한 사용 ... "과 중복되므로 닫지 마십시오. 강렬한 연구에도 불구하고 나는 내 문제를 해결하는 비슷한 스레드를 찾을 수 없었습니다.스위프트 3/해결 방법 : "승인 (_ : 완료 :)" "
내가 스위프트 3 프로젝트를 통해 업데이트 및 컴파일러 오류에 붙어:
Ambiguous use of 'authorize(_:completion:)'
코드 :
func connectToInstagram() {
let auth: NSMutableDictionary = ["client_id": INSTAGRAM_CLIENT_ID,
SimpleAuthRedirectURIKey: INSTAGRAM_REDIRECT_URI]
SimpleAuth.configuration()["instagram"] = auth
SimpleAuth.authorize("instagram") { (anyObject, error) in // error here
if anyObject != nil {...
SimpleAuth이 목적으로 작성된 소셜 미디어 인증을 처리 할 수있는 프레임 워크입니다 C.
SimpleAuth :
,SimpleAuthRequestHandler :
public typealias SimpleAuthRequestHandler = (Any?, Error?) -> Swift.Void
public let SimpleAuthPresentInterfaceBlockKey: String
public let SimpleAuthDismissInterfaceBlockKey: String
I가 줄을 변경하는 것을 시도했다
: 예상대로
_ = SimpleAuth.authorize("instagram") { (anyObject: Any?, error: Error?) in
_ = SimpleAuth.authorize("instagram", completion: { (anyObject: Any?, error: Error?) in
그러나, 그것은 변화하지 않았다 아무것도 . 내가 뭘 놓치고 있니? 도움말은 매우 감사하겠습니다.
빌드 로그 :
xy/InstagramVC.swift:409:9: error: ambiguous use of 'authorize(_:completion:)'
SimpleAuth.authorize("instagram") { (any: Any?, error: Error?) -> Swift.Void in
^
SimpleAuth.SimpleAuth:24:21: note: found this candidate
open class func authorize(_ provider: String!, completion: SimpleAuth.SimpleAuthRequestHandler!)
^
SimpleAuth.SimpleAuth:34:21: note: found this candidate
open class func authorize(_ provider: String!, options: [AnyHashable : Any]! = [:], completion: SimpleAuth.SimpleAuthRequestHandler!)
빌드 로그를 확인하거나 명령 줄에서 빌드하십시오. 내가 아는 한 컴파일러는 모호성을 유발하는 범죄자 목록을 제공 할 수 있습니다. – courteouselk
@AntonBronnikov 빌드 로그 정보로 질문을 편집했습니다. –
제가 틀렸다면 정정하십시오. 그러나 두 가지 방법이 모호합니다 ('options' 인수가있는 값은 기본값을 갖기 때문에 줄일 수 있습니다). 다른 하나와 정확히 같은 서명으로).디폴트 값 (이 비트는'= [:]')을 제거하려고 시도합니다. – courteouselk