-
Notifications
You must be signed in to change notification settings - Fork 1
[Feature/#87] Coordinator 적용 및 나가기 버튼 구현 #97
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
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.
고생하셨습니다 ㅠㅠ
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.
고생 많으셨습니다 ~! 잠은 주무셨나요ㅠㅜ
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를 도입하게 되었습니다. - 초기화 시점이 AppRoot시점이다. (필요한 시점에 초기화 불가) - 나가기 플로우의 복잡성 - 초기화 시점이 AppRoot이다 보니, CRDT의 피어들의 ID를 전달 할땐, 연결이 이루어지지 않음.
Coordinator 적용
Coordinator는 다음과 같이 구성됩니다.
우선, Coordinator에서 필요한 객체들의 바구니인 Container가 존재합니다.
이 Container는 Dependency를 통해 상위 Coordinator에게 필요한 의존성을 요구할 수 있습니다.
다음과 같이 부모는 자식의 Dependecy를 채택해야 합니다.
이때, 부모 타입에서는 Container만 들고 있으면
coordinator()
라는 메서드를 통해 코디네이터를 생성할 수 있습니다.또한, Coordinator는 트리구조를 형성하고 있기 때문에 Listner를 통해 이벤트를 전달할 수 있습니다.
현재 하나의 ViewController에 top과 bottom을 나누는 구조로 되어있습니다.
top의 경우 그룹의 정보 뷰로 고정이지만 bottom에서는 뷰의 전환이 일어납니다.
top에서 나가기 버튼을 클릭시 bottom에서 첫 화면으로 나가야 합니다.
하지만, Coordinator에선 top에서 listener를 통해 상위로 전달할 수 있습니다.
이때 상위는 bottom의 메서드를 호출 시켜 나가기를 구현할 수 있게 되었습니다.