-
Notifications
You must be signed in to change notification settings - Fork 6
[Feat] #132 - 방문자 플로우 구현 #142
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
The head ref may contain hidden characters: "feat/#132-\uBC29\uBB38\uC790-\uD50C\uB85C\uC6B0"
Conversation
dlwogus0128
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
옛날에는 코드가 다 어렵게만 보여서 하나도 이해가 안 갔는데.. 지금은 그래도 어떤 식으로 코드를 작성하셨는지 전부는 아니더라도 이해가 가서! 신기해요.. 적절한 함수명 명명이라던지.. 코드가 깔끔해서 다른 사람이 봐도 흐름이 눈에 보이게 작성하시는 점이 넘 멋있습니다.. 저도 좀 더 노력해서 ㅋ 알아듣기 쉬운 코드를 짜도록 해볼게요! 수고하셨습니다!
| } | ||
|
|
||
| @objc private func completeButtonDidTap() { | ||
| guard handleVisitor() else { return } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
로그인을 하고 나면 방문자 변수를 false로 하는 방식으로 방문자인지 아닌지를 구분하는 거군녀!! 신기하네요
| var leftButtonTapAction: (() -> Void)? | ||
| var rightButtonTapAction: (() -> Void)? | ||
|
|
||
| private var cancelBag = CancelBag() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cancleBag은 combine을 써서 할당된 액션을 다 취소해주려고 선언하신 거죠..? 넘 신기한 기능이네요.. 나중에 콤바인 공부하고 다시 살펴볼게요
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Combine은 스트림을 생성하여 비동기적으로 액션을 처리하는 (반응형이라는 명칭이 있음) 프레임워크에요!
cancelBag은 RxSwift처럼 이 스트림을 관리하기 위해 한번 감싼 객체입니다. 원래는 Set<AnyCancellable> 로 선언해야해요!
클래스의 deInit 시점에 연결해놓은 스트림을 취소하기 위해 선언한 거에요~!
Combine을 공부하기 전에 클로저를 사용한 비동기처리를 먼저 공부하고 도전해보면 좋아요! 매우 편리합니다
| var urlRequest = urlRequest | ||
|
|
||
| // 방문자일 경우 | ||
| if UserManager.shared.userType == .visitor && urlRequest.url?.absoluteString.hasPrefix(Config.baseURL) == true { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
urlRequest의 앞부분이 저희 baseurl과 같은지 확인하는 이유가 따로 있나요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
코스 출발지 검색 api는 카카오 주소 api를 사용하고 있기 때문에 저희 서버 baseUrl과 달라요! 그래서 이 api 호출에서는 방문자를 분기처리할 필요가 없습니다.
사실 이 api 호출시에는 AuthInterCeptor가 실행되지 않도록 했지만 혹시 모르니 한번 더 안전장치로 걸러주고 있습니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아 그렇쿤요!1 이해했습니다 감사합니다!
저도 깔끔한 코드를 작성하려고는 하지만 아직 많이 부족해요! |
🌱 작업한 내용
🌱 PR Point
📸 스크린샷
📮 관련 이슈