-
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
[Refactor] #239 - 화면 전환 Coordinator Router 로직 분리 #240
Open
mini-min
wants to merge
18
commits into
develop
Choose a base branch
from
test/#1
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Conflicts: # TOASTER-iOS/Present/DetailClip/View/DetailClipViewController.swift # TOASTER-iOS/Present/EditClip/View/EditClipViewController.swift
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
✨ 해결한 이슈
🛠️ 작업내용
원래 예전에 하자고 했던 Coordinator Pattern을 그냥 공부할 겸 대작업해서 올렸습니다!
따로 회의를 가진지가 오래되서 별도의 설명이 필요할 것 같긴 한데 / 나중에 다덜 여유되면 코드 살펴보고 - 수정하거나 질문받고 - 머지해서 적용해보면 좋을 듯해요!
🖥️ 주요 코드 설명
코드 설명에 대한 내용은 블로그로 올렸습니다~~!
이해 안되는 부분 질문 주시길~ 혹은 개선 필요사항 있으면 거침없이 피드백 주시길~~
(코드 사용 설명)
Clip 탭 기준으로 설명하면, 클립에서 이루어지는 모든 화면 전환은 ClipCoordinator에서 관리하는 느낌입니다.
이때, 다음으로 이동할 뷰나 / 클로저에 대한 부분은 Coordinator가, 구체적으로 어떻게 화면을 전환할지는 Router가 담당하게 됩니다.
아래 코드를 살펴보면,
TabCoordinator에서는 클립 탭을 선택하면, ClipCoordinator를 생성하고 start() 메서드 부분이 동작합니다.
start에서는 ClipVC를 Factory에서 만들고 - router를 통한 화면 전환 방식을 정의하구 있죠.
TOASTER-iOS/TOASTER-iOS/Application/Coordinator/Coordinators/ClipCoordinator.swift
Lines 10 to 43 in ef8ae99
쭉쭉쭉 클로저로 이어서 이어서 가면, 다음 VC를 만들고 - 화면을 전환하고 - 클로저 호출하고 이 부분이 반복되는 흐름입니다.
TOASTER-iOS/TOASTER-iOS/Application/Coordinator/Coordinators/ClipCoordinator.swift
Lines 45 to 67 in ef8ae99
정리하면, 각 VC에서 흩어져있던 객체 생성과, 화면 전환 코드를 그냥 Coordinator라는 한 곳에서 모두 관리한다! 라고 생각하시면 되겠네요.
질문있으면, 디코에서 기다리고 있겠습니다.
그럼 다덜 화이팅.
✅ Checklist