Open
Conversation
jayn2u
approved these changes
Nov 13, 2024
Contributor
jayn2u
left a comment
There was a problem hiding this comment.
네트워크는 많이 사면 많이 할수록 많이 배우는 것 같아요!
|
|
||
| let loginView = LoginView() | ||
|
|
||
| let loginViewModel = LoginViewModel() // 뷰모델 인스턴스 생성 |
Contributor
There was a problem hiding this comment.
MVC 아키텍처에서는 ViewModel이라는 키워드를 사용하지 않아요! 만약 MVVM에서 말하는 ViewModel이 아니라면 다르게 이름을 바꾸는 것을 추천합니다.
Comment on lines
+60
to
+91
| @objc func handleKakaoLoginButtonTapped() { | ||
| // 카카오톡 설치 여부에 따라 로그인 진행 방식 결정 | ||
| if UserApi.isKakaoTalkLoginAvailable() { | ||
| UserApi.shared.loginWithKakaoTalk { (oauthToken, error) in | ||
| if let error = error { | ||
| print("카카오톡 로그인 에러: \(error.localizedDescription)") | ||
| self.showAlert(title: "로그인 오류", message: "카카오톡 로그인 중 오류가 발생했습니다.") | ||
| } else { | ||
| print("카카오톡 로그인 성공") | ||
| if let token = oauthToken?.accessToken { | ||
| self.saveTokenToKeychain(token: token) | ||
| } | ||
| self.fetchUserNickname() | ||
| self.navigateToMainTabBarController() | ||
| } | ||
| } | ||
| } else { | ||
| UserApi.shared.loginWithKakaoAccount { (oauthToken, error) in | ||
| if let error = error { | ||
| print("카카오 계정 로그인 에러: \(error.localizedDescription)") | ||
| self.showAlert(title: "로그인 오류", message: "카카오 계정 로그인 중 오류가 발생했습니다.") | ||
| } else { | ||
| print("카카오 계정 로그인 성공") | ||
| if let token = oauthToken?.accessToken { | ||
| self.saveTokenToKeychain(token: token) | ||
| } | ||
| self.fetchUserNickname() | ||
| self.navigateToMainTabBarController() | ||
| } | ||
| } | ||
| } | ||
| } |
Contributor
There was a problem hiding this comment.
좋습니다. 네트워크 통신에 있어서 해당 코드가 가장 핵심이에요. 스터디 때 다른 사람들을 위해서 공유해주었으면 좋겠어요!
jayn2u
approved these changes
Nov 13, 2024
Contributor
jayn2u
left a comment
There was a problem hiding this comment.
API KEY는 민감한 정보라서 절대 공유하면 안돼요.
|
|
||
|
|
||
| // Kakao SDK 초기화 | ||
| KakaoSDK.initSDK(appKey: "2c8ab94e144d90c1bb9598fb2443dea1") |
Contributor
There was a problem hiding this comment.
API KEY를 퍼블릭 레포지토리로 공유하는 건 절대 하면 안돼요!
hyojin425
approved these changes
Nov 14, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
iOS Pull Request
주차별 학습내용 기록
궁금한 점 & 스터디원들과 의논해보고 싶은 점
체크리스트
main브랜치로 병합하는 것을 확인했습니까?시연영상