Skip to content

Conversation

@soeun11
Copy link
Collaborator

@soeun11 soeun11 commented Nov 13, 2024

iOS Pull Request

주차별 학습내용 기록

작성자가 편한대로 주차별 학습한 내용을 기록해주세요

  • 내용

궁금한 점 & 스터디원들과 의논해보고 싶은 점

스터디 간 궁금한 점들에 대해서 작성해주세요.
파트장의 도움이 필요할 때는 디스코드 iOS 질문 채널을 이용해주세요.

  • 내용

체크리스트

  • 주차별 스터디 라벨을 할당했습니까?
  • 충돌문제를 해결했습니까?
  • PR 병합 방향을 확인했습니까? 작성자 본인의 main 브랜치로 병합하는 것을 확인했습니까?

시연영상

시연 영상을 첨부해주세요

@soeun11 soeun11 added the Week7 label Nov 13, 2024
Copy link
Contributor

@jayn2u jayn2u left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

네트워크는 많이 사면 많이 할수록 많이 배우는 것 같아요!


let loginView = LoginView()

let loginViewModel = LoginViewModel() // 뷰모델 인스턴스 생성
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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()
}
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

좋습니다. 네트워크 통신에 있어서 해당 코드가 가장 핵심이에요. 스터디 때 다른 사람들을 위해서 공유해주었으면 좋겠어요!

Copy link
Contributor

@jayn2u jayn2u left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API KEY는 민감한 정보라서 절대 공유하면 안돼요.



// Kakao SDK 초기화
KakaoSDK.initSDK(appKey: "2c8ab94e144d90c1bb9598fb2443dea1")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API KEY를 퍼블릭 레포지토리로 공유하는 건 절대 하면 안돼요!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants