Skip to content

Commit

Permalink
[refactor] NewNoteDatePickerViewController 리팩토링 #302
Browse files Browse the repository at this point in the history
  • Loading branch information
skkimeo committed Jul 1, 2023
1 parent 47c2356 commit 524c34d
Show file tree
Hide file tree
Showing 5 changed files with 181 additions and 200 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,18 +90,17 @@ final class HomeTabViewController: UIViewController {
if !bottle.hasEmptyDate {
return self.present(self.noEmptyDateAlert(), animated: true)
}

if bottle.isEmtpyToday {
// NewNoteInputViewController
self.navigationController?.pushViewControllerWithFade(
to: NewNoteInputViewController(
viewModel: .init(newNote: .init(date: Date(), bottle: bottle))
)
)
} else {
// NewNoteDatePickerViewController
self.navigationController?.pushViewControllerWithFade(
to: UIViewController().then { $0.view.backgroundColor = .orange }
to: NewNoteDatePickerViewController(
viewModel: .init(newNote: .init(date: Date(), bottle: bottle)),
parent: .home)
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@ final class HomeViewController: UIViewController {
else { return }

let viewModel = NewNoteDatePickerViewModel(newNote: .init(date: Date(), bottle: bottle))
dateViewController.viewModel = viewModel
}

if segue.identifier == SegueIdentifier.presentBottleMessageView {
Expand Down
Loading

0 comments on commit 524c34d

Please sign in to comment.