LINEログイン連携の実装を練習しているのですが、以下のエラーが出てしまい色々調べてもわからなかった為質問させていただきます。
エラー内容
mbiguous reference to member
エラー箇所
Swift
1import LineSDK 2 3class LoginViewController: UIViewController { 4 /// Lineログインタップアクション 5 @IBAction func lineLoginButtonTapped() { 6 LineSDKLogin.sharedInstance().delegate = self // Lineログイン処理開始1 7 LineSDKLogin.sharedInstance().start() // Lineログイン処理開始2(結果はextensionのdidLoginで受け取る) 8 } 9 10 override func viewDidLoad() { 11 super.viewDidLoad() 12 // Do any additional setup after loading the view, typically from a nib. 13 14 } 15 16 17} 18 19 20extension LoginViewController: LineSDKLoginDelegate { 21 func didLogin( 22 _ login: LineSDKLogin, 23 credential: LineSDKCredential?, 24 profile: LineSDKProfile?, 25 error: Error? 26 ) { 27 28 log?.debug("login check!") //←ここAmbiguous reference to member 'log' 29 30 if let _error = error { 31 log?.error("error: (_error.localizedDescription)") //Ambiguous reference to member 'log' //←ここAmbiguous reference to member 'log' 32 // 1. キャンセルあるいは設定ミスなどによりログインできなかった場合の処理 33 return 34 } 35 36 // クレデンシャルの有無 37 guard let _credential = credential, 38 let _profile = profile else { 39 log?.error("Failed to login by Line. credential or profile is nil.") //←ここAmbiguous reference to member 'log' 40 return 41 } 42 43 // アクセストークンの有無 44 guard (_credential.accessToken?.accessToken) != nil else { 45 log?.error("Failed to login by Line. accessToken is not as String.") //←ここAmbiguous reference to member 'log' 46 return 47 } 48 49 // /// 表示名(Line) 50 // let userName = _profile.displayName 51 // /// ユーザーID(Line) 52 // let userId = _profile.userID 53 // /// ステータスメッセージ(Line) 54 // let statusMessage = _profile.statusMessage 55 // /// 画像URL(Line) 56 // let pictureUrl = _profile.pictureURL 57 58 59 // 2. ログイン成功時ここにくる 60 performSegue(withIdentifier: "goViewController", sender: nil) 61 } 62} 63
以上です
よろしくお願い致します
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/01/03 12:06
2019/01/03 12:12