Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set [#46] apple login 기초 세팅 #57

Merged
merged 18 commits into from
Jan 12, 2024
Merged

Conversation

kim-seonwoo
Copy link
Member

👾 작업 내용

  • 애플 로그인 권한 설정 부분에서 sign in with apple을 추가하였습니다.

UserWrapper 생성

  • UserWrapper는 UserDefault의 처리를 용이하게 해줍니다.
  • 설정과 업데이트와 리무브를 이쪽에서 판단하여 처리해주어 코드가 간결해집니다.
  • UserDefault와 UserManager를 쉽게 동기화 시켜 줍니다.
  • 애플 로그인 버튼을 눌렀을 때 이벤트를 구현하였습니다.
  • 애플 로그인이 성공했을 때의 로직을 간단하게 구현하였습니다.

User관련 정보 접근을 용이하게 하는 UserManager 파일을 생성하였습니다.

  • 값을 설정하거나 수정할때 update~ 에 해당되는 메소드를 사용하여 설정해줍니다.
  • UserManager 파일의 요소에 접근하고 싶으면, get~ 에 해당되는 메소드를 골라 불러와 줍니다.
  • 임의로 다음과 같은 로직을 추가하여 구현하였습니다.
            if (UserManager.shared.appleUserIdentifier != nil) {
                let nextViewController = TabBarController()
                self.navigationController?.pushViewController(nextViewController, animated: true)
            } else {
                let nextViewController = TimeSurveyViewController()
                self.navigationController?.pushViewController(nextViewController, animated: true)
            }

🚀 PR Point

  • SignInModel의 네이밍이 구체화가 안된 이슈로 에러가 발생할 수 있을 것 같아, 일단 에러처리 하였습니다.
  • SceneDelegate에 애플로그인에 따른 상태처리관련 코드는 일단 남겨두었습니다.
  • API는 아직 추가하지 않았습니다. 일단 주석으로 코멘트를 달아 놨습니다. 추후에 적용할 생각입니다.
  • UI구현은 따로 없으므로 기기대응 화면 추가 하지 않겠습니다.

📸 스크린샷

구현 내용 스크린샷
로그인 화면 image

✅ Issue

Resolved #46

@kim-seonwoo kim-seonwoo added 😎선우 선우의 issue ⚒️ set 세팅할 시 labels Jan 12, 2024
@kim-seonwoo kim-seonwoo added this to the 🚀1차 스프린트🚀 milestone Jan 12, 2024
@kim-seonwoo kim-seonwoo self-assigned this Jan 12, 2024
Copy link
Contributor

@boyeon0119 boyeon0119 left a comment

Choose a reason for hiding this comment

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

아주 나이스 하네여

Copy link
Member

@Zoe0929 Zoe0929 left a comment

Choose a reason for hiding this comment

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

P2. 고생하셨습니다.

Comment on lines 44 to 47
//애플 로그인 토큰 리프레쉬 로직. 성공한다면 엑세스와 리프레시 토큰 업데이트 그러면서 이동
// 토큰 리프레시가 실패 한다. 로그인 컨트롤러로 바로 이동.
// UserManager.shared.updateToken(,)

Copy link
Member

Choose a reason for hiding this comment

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

주석 예쁘게 달아주세요 !! 줄 맞춤해주세요!

Comment on lines +8 to +30
//import Foundation
//
//struct SignInModel {
// let socialPlatform: String
// let onboarding: Onboarding
// let challenge: Challenge
//}
//
//struct Onboarding {
// let averageUseTime: String
// let problem: [String]
//}
//
//struct Challenge {
// let period: Int
// let goalTime: Int
// let apps: [Apps]
//}
//
//struct Apps {
// let appCode: String
// let goalTime: Int
//}
Copy link
Member

Choose a reason for hiding this comment

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

P2. 사용하지 않는 파일은 삭제해주세요

@kim-seonwoo kim-seonwoo merged commit 324c441 into develop Jan 12, 2024
@Zoe0929 Zoe0929 deleted the set/#46-AppleLogin branch June 12, 2024 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⚒️ set 세팅할 시 😎선우 선우의 issue
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[Set] 애플 로그인 환경 설정
3 participants