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

[iOS] 코디네이터 리팩토링 #343

Merged
merged 4 commits into from
Jan 7, 2024

Conversation

SwiftyJunnos
Copy link
Member

@SwiftyJunnos SwiftyJunnos commented Jan 3, 2024

❗ 배경

작업 배경에 대한 설명을 작성합니다.
Issue에 대한 링크를 첨부합니다.

🔧 작업 내역

작업한 내용들을 나열합니다.
간결하게 리스트 업하고, 자세한 설명은 아래 리뷰 노트에서 합니다.

  • Coordinator 개선

📝 리뷰 노트

작업 내역에 대한 자세한 설명을 작성합니다.

FinishDelegate

여러 protocol로 세분화되어 있던 delegateCoordinatorFinishDelegate 하나로 통합시켰습니다.

extension HomeCoordinator: CoordinatorFinishDelegate {
    
    func shouldFinish(childCoordinator: Coordinator) {
        guard let homeViewController = self.rootViewController else { return }
        
        self.childCoordinators.removeAll { $0 === childCoordinator }
        self.navigationController.popToViewController(homeViewController, animated: true)
    }
    
}

이렇게 delegate는 하나로 통합하고

Feature 레이어에 정의한 NavigationDelegate의 구현부에서 finish 메서드를 호출하는 것으로 Coordinator를 메모리에서 해제시킬 수 있습니다.

SelectSong과 SaveJourney 코디네이터 통합

따로 분리되어 있던 Coordinator 두 개를 하나의 Flow로 생각해 통합했습니다.

SaveJourneyFlowCoordinator.swift 파일에서 확인하실 수 있습니다.

해당 코디네이터는 SelectSong과 SaveJourney ViewController를 관리합니다.

📸 스크린샷

작업한 내용에 대한 스크린샷, 영상 등을 첨부합니다.

@SwiftyJunnos SwiftyJunnos added the ♻️ 리팩토링 코드 동작 방식 변경, 리팩토링 label Jan 3, 2024
@SwiftyJunnos SwiftyJunnos self-assigned this Jan 3, 2024
@SwiftyJunnos SwiftyJunnos linked an issue Jan 3, 2024 that may be closed by this pull request
1 task
@SwiftyJunnos SwiftyJunnos marked this pull request as ready for review January 4, 2024 13:25
@SwiftyJunnos SwiftyJunnos enabled auto-merge January 4, 2024 13:25
Copy link
Member

@PushedGun PushedGun left a comment

Choose a reason for hiding this comment

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

수고하셨습니다!

@SwiftyJunnos SwiftyJunnos merged commit 56f06a2 into iOS/release Jan 7, 2024
105 checks passed
@SwiftyJunnos SwiftyJunnos deleted the iOS/task/Coordinator-Refactor branch January 7, 2024 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
♻️ 리팩토링 코드 동작 방식 변경, 리팩토링
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Coordinator 개선
2 participants