Skip to content

Commit

Permalink
#8 feat: HomeCoordinator에 showRingtoneSelectScene 로직 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
sanghyeok-kim committed Aug 3, 2023
1 parent 8307d7f commit 8939b14
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ final class DefaultHomeCoordinator: HomeCoordinator {
presentTimerCreateViewController(createdTimerRelay: createdTimerRelay)
case .showTimerEditScene(let initialTimer, let editedTimerRelay):
pushTimerEditViewController(initialTimer: initialTimer, editedTimerRelay: editedTimerRelay)
case .showRingtoneSelectScene(let selectedRingtoneRelay):
presentRingtoneSelectViewController(selectedRingtoneRelay: selectedRingtoneRelay)
case .finishTimerCreateScene:
navigationController.dismiss(animated: true)
case .finishTimerEditScene:
Expand Down Expand Up @@ -72,4 +74,11 @@ private extension DefaultHomeCoordinator {
timerEditingViewController.reactor = timerEditingReactor
navigationController.pushViewController(timerEditingViewController, animated: true)
}

func presentRingtoneSelectViewController(selectedRingtoneRelay: BehaviorRelay<Ringtone>) {
let ringtoneSelectViewController = RingtoneSelectViewController()
let ringtoneSelectReactor = RingtoneSelectReactor(selectedRingtoneRelay: selectedRingtoneRelay)
ringtoneSelectViewController.reactor = ringtoneSelectReactor
navigationController.visibleViewController?.present(ringtoneSelectViewController, animated: true)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ enum HomeCoordinatorAction {
case appDidStart
case showTimerCreateScene(createdTimerRelay: PublishRelay<Timer>)
case showTimerEditScene(initialTimer: Timer, editedTimerRelay: PublishRelay<Timer>)
case showRingtoneSelectScene(selectedRingtoneRelay: BehaviorRelay<Ringtone>)
case finishTimerCreateScene
case finishTimerEditScene
}

0 comments on commit 8939b14

Please sign in to comment.