-
Notifications
You must be signed in to change notification settings - Fork 2
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
[Feat] OnboardingCoordinator - 플로우 연결 #189
base: develop
Are you sure you want to change the base?
Conversation
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.
전반적으로 Coordinator에서 자식의 State, Action을 scope로 들고 있어야하나가 의문입니다.
그거 안해도 .routeAction에서 다 자식 action을 처리할 수 있을 것 같아서요!
ex)
// AppCoordinator.swift
// 최상단 앱 코디네이터에서 splash에서 goToMainScreen 액션을 보내면
// 현재 라우트를 mainTab으로 덮어씌우고 시키는 함수
case .router(.routeAction(_, action: .splash(.goToMainScreen))):
state.routes = [.root(.mainTab(.init))]
추가로 print 제거 신경 써주시면 감사하겠습니다!
|
||
@ObservableState | ||
struct State: Equatable { | ||
var loginState: OnboardingLoginStore.State |
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.
state를 코디네이터에 저장할 필요가 있나요?
아니라면 각 state와 scope빼고 route로만 관리해도 될 것 같네요
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.
없어보입니다..! 알려주신대로 state scope aciton 내용 제거해서 반영해보겠습니다
// 약관 동의 화면으로 이동 | ||
case .login(.goToNextScreen): | ||
print("되는건가") | ||
state.routes.append(.push(.agreement(state.agreementState))) |
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.
routes.append 없이 바로 .push 가능합니다.
state.routes.push(.agreement(...
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.
와 꿀팁 감사합니다... 가독성이 훨씬 좋습니다 반영하겠습니다!
|
||
// 약관 동의 화면으로 이동 | ||
case .login(.goToNextScreen): | ||
print("되는건가") |
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.
print 제거 부탁드립니다!
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.
앗 삭제를 빼먹었습니다 죄송합니다 ㅠㅠ
splash: .init(), | ||
onBoarding: .init(onBoarding: .init())) | ||
splash: .initialState, | ||
onboarding: .initialState) | ||
var routes: [Route<AppScreen.State>] | ||
var mainTab: MainTabCoordinator.State |
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.
여기서도 굳이 자식 state를 모두 들고 있을 필요는 없어 보입니다.
|
||
// Splash - 로그인 체크 결과 화면 라우팅 | ||
case .router(.routeAction(_, action: .splash(let action))): | ||
switch action { |
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.
이렇게 하면 화면 별 화면 이동을 보기 좋은 것 같습니다.👍👍
.root(.onboarding(.manualState([ | ||
.root(.login(.init()), embedInNavigationView: true), | ||
.push(.agreement(.init())) | ||
]))) |
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.
이 부분이 이해가 안되네요.
AppCoordinator -> OnboardingCoordinator를 띄우면서 agreement를 push하는건가요?
그렇다면 그냥
AppCoordinator -> OnboardingCoordinator를 push하면서 그 root로 agreement를 하면 될 것 같습니다.
그러면 manualState 함수도 필요 없어보이는데요
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.
앱 첫 진입 시 로그인 로직을 체크하여 AppCoordi -> OnboardingCoordi 를 표시하고,
분기처리하여 [root, n번 화면]의 구성을 가져가려 이렇게 구성했습니다..!
AppCoordinator의 라우팅으로 OnboardingCoordinator의 라우팅까지 건드려야해서
일단은 이렇게 구성했습니다
연현님과의 1:1 미팅 후
으로 개선 작업 방향이 잡혔습니다. |
@iHyunWoo @Seokki-Kwon |
Related Issue
Description
온보딩 플로우에 포함된 화면과 Coordinator의 연결을 작성했습니다.
App 시동 시 AppCoordinator 부터 시작하며, 첫 Splash Coordinator에서 유저 로그인 상태를 체크합니다.이후 유저 상태에 따라 AppCoordinator에서 로그인,온보딩(OnboardingCoordinator) / 메인(MainTabCoordinator) 화면 분기처리를 진행합니다.
-> 수정되었습니다!
App 시동 시 AppCoordinator 부터 시작하며, 첫 Onboarding Coordinator에서 유저 로그인 상태를 체크합니다.
이후 유저 상태에 따라 온보딩(OnboardingCoordinator에서 라우팅) / 메인(AppCoordinator -> MainTabCoordinator) 화면 분기처리를 진행합니다.
Splash,OnboardingCoordinator 를 작성했습니다.Screenshot (Optional)
Requirements for Review
코디네이터 로직 관련해서 좋은 레퍼런스가 될 지는 모르겠습니다..! 이상한 부분 보이면 꼭 말씀 부탁드립니다!
+
수정 필요부분 반영했습니다!