Skip to content

Commit

Permalink
#8 rename: TimerCreateViewModel, TimerEditingViewModel의 네이밍 변경 (ViewM…
Browse files Browse the repository at this point in the history
…odel -> Reactor)
  • Loading branch information
sanghyeok-kim committed Aug 3, 2023
1 parent 85ecfe9 commit a9ed860
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 24 deletions.
16 changes: 8 additions & 8 deletions Multimer/Multimer.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
1E651DAC2953165800B4F321 /* CountUpTimerUseCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E651DAB2953165800B4F321 /* CountUpTimerUseCase.swift */; };
1E651DAE2953168900B4F321 /* TimerUseCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E651DAD2953168900B4F321 /* TimerUseCase.swift */; };
1E651DB0295342BA00B4F321 /* TimerCreateViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E651DAF295342BA00B4F321 /* TimerCreateViewController.swift */; };
1E651DB229534CEE00B4F321 /* TimerCreateViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E651DB129534CEE00B4F321 /* TimerCreateViewModel.swift */; };
1E651DB229534CEE00B4F321 /* TimerCreateReactor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E651DB129534CEE00B4F321 /* TimerCreateReactor.swift */; };
1E6A19C329937FE8001FA3ED /* NameTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E6A19C229937FE8001FA3ED /* NameTextField.swift */; };
1E6A19C82993AF21001FA3ED /* SwipeRightToStopNoticeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E6A19C72993AF21001FA3ED /* SwipeRightToStopNoticeView.swift */; };
1E6FAD9729403F900021B845 /* CoreDataTimerRepository.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E6FAD9629403F900021B845 /* CoreDataTimerRepository.swift */; };
Expand Down Expand Up @@ -92,7 +92,7 @@
1EBEEFE82925B73000299CE7 /* TagColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EBEEFE72925B73000299CE7 /* TagColor.swift */; };
1EBEEFEA2925B85700299CE7 /* TagButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EBEEFE92925B85700299CE7 /* TagButton.swift */; };
1EBEF029292909DD00299CE7 /* TimerModel.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 1EBEF027292909DD00299CE7 /* TimerModel.xcdatamodeld */; };
1EBFEE152919270D00747606 /* TimerEditingViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EBFEE142919270D00747606 /* TimerEditingViewModel.swift */; };
1EBFEE152919270D00747606 /* TimerEditingReactor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EBFEE142919270D00747606 /* TimerEditingReactor.swift */; };
7DE0DCB2BD437A3652CA4266 /* Pods_Multimer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FB67573CFCDE896B6E52525A /* Pods_Multimer.framework */; };
8C88084EF84FB8081FC09CDE /* Pods_MultimerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 02A9A991A8E30450D4458665 /* Pods_MultimerTests.framework */; };
C60ADD68060EFDAE377DA4B2 /* Pods_Multimer_MultimerUITests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 09D9588E5DAECA7EB7A30024 /* Pods_Multimer_MultimerUITests.framework */; };
Expand Down Expand Up @@ -173,7 +173,7 @@
1E651DAB2953165800B4F321 /* CountUpTimerUseCase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CountUpTimerUseCase.swift; sourceTree = "<group>"; };
1E651DAD2953168900B4F321 /* TimerUseCase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimerUseCase.swift; sourceTree = "<group>"; };
1E651DAF295342BA00B4F321 /* TimerCreateViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimerCreateViewController.swift; sourceTree = "<group>"; };
1E651DB129534CEE00B4F321 /* TimerCreateViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimerCreateViewModel.swift; sourceTree = "<group>"; };
1E651DB129534CEE00B4F321 /* TimerCreateReactor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimerCreateReactor.swift; sourceTree = "<group>"; };
1E6A19C229937FE8001FA3ED /* NameTextField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NameTextField.swift; sourceTree = "<group>"; };
1E6A19C72993AF21001FA3ED /* SwipeRightToStopNoticeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwipeRightToStopNoticeView.swift; sourceTree = "<group>"; };
1E6FAD9629403F900021B845 /* CoreDataTimerRepository.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CoreDataTimerRepository.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -217,7 +217,7 @@
1EBEEFE72925B73000299CE7 /* TagColor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TagColor.swift; sourceTree = "<group>"; };
1EBEEFE92925B85700299CE7 /* TagButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TagButton.swift; sourceTree = "<group>"; };
1EBEF028292909DD00299CE7 /* TimerModel.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = TimerModel.xcdatamodel; sourceTree = "<group>"; };
1EBFEE142919270D00747606 /* TimerEditingViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimerEditingViewModel.swift; sourceTree = "<group>"; };
1EBFEE142919270D00747606 /* TimerEditingReactor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimerEditingReactor.swift; sourceTree = "<group>"; };
2487B77C56F24FE0EFA05BD4 /* Pods-Multimer.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Multimer.release.xcconfig"; path = "Target Support Files/Pods-Multimer/Pods-Multimer.release.xcconfig"; sourceTree = "<group>"; };
50F7E195491911071C2CCC09 /* Pods-MultimerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MultimerTests.debug.xcconfig"; path = "Target Support Files/Pods-MultimerTests/Pods-MultimerTests.debug.xcconfig"; sourceTree = "<group>"; };
6AE47EFBE8192C59957931B9 /* Pods-Multimer.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Multimer.debug.xcconfig"; path = "Target Support Files/Pods-Multimer/Pods-Multimer.debug.xcconfig"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -396,7 +396,7 @@
isa = PBXGroup;
children = (
1E482BCF2912887B00175B78 /* TimerEditingViewController.swift */,
1EBFEE142919270D00747606 /* TimerEditingViewModel.swift */,
1EBFEE142919270D00747606 /* TimerEditingReactor.swift */,
1E4CB4E82967395200FC918E /* TimePickerView */,
1E4CB4E7296738C100FC918E /* CustomView */,
);
Expand All @@ -407,7 +407,7 @@
isa = PBXGroup;
children = (
1E651DAF295342BA00B4F321 /* TimerCreateViewController.swift */,
1E651DB129534CEE00B4F321 /* TimerCreateViewModel.swift */,
1E651DB129534CEE00B4F321 /* TimerCreateReactor.swift */,
);
path = TimerCreate;
sourceTree = "<group>";
Expand Down Expand Up @@ -932,7 +932,7 @@
1EBEEFDC292105F500299CE7 /* TimerTableViewDiffableDataSource.swift in Sources */,
1E651DB0295342BA00B4F321 /* TimerCreateViewController.swift in Sources */,
1E482BD6291353FF00175B78 /* TimePickerViewDelegate.swift in Sources */,
1E651DB229534CEE00B4F321 /* TimerCreateViewModel.swift in Sources */,
1E651DB229534CEE00B4F321 /* TimerCreateReactor.swift in Sources */,
1E482BD22913538800175B78 /* TimerViewCell.swift in Sources */,
1E744BAC296C488A00CD824D /* UIImage+makeSFSymbolImage.swift in Sources */,
1E4CB4DE2966BE9000FC918E /* TimerMO+CoreDataClass.swift in Sources */,
Expand Down Expand Up @@ -969,7 +969,7 @@
1EA3FCE8292E4B730073560D /* CoreDataStorage+TagMO.swift in Sources */,
1EA3FCE0292E43520073560D /* ManagedObjectConvertible.swift in Sources */,
1E4159EE29485C6900EDA065 /* TimerEditingView.swift in Sources */,
1EBFEE152919270D00747606 /* TimerEditingViewModel.swift in Sources */,
1EBFEE152919270D00747606 /* TimerEditingReactor.swift in Sources */,
1E4159F2294C0BDB00EDA065 /* TimeFactory.swift in Sources */,
1E48FE992911F9240090B246 /* AppDelegate.swift in Sources */,
1E744BB3296C488A00CD824D /* EditViewButtonType.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ private extension DefaultHomeCoordinator {

func presentTimerCreateViewController(createdTimerRelay: PublishRelay<Timer>) {
let timerCreateViewController = TimerCreateViewController()
let timerCreateReactor = TimerCreateViewModel(
let timerCreateReactor = TimerCreateReactor(
coordinator: self,
createdTimerRelay: createdTimerRelay
)
Expand All @@ -64,7 +64,7 @@ private extension DefaultHomeCoordinator {

func pushTimerEditViewController(initialTimer: Timer, editedTimerRelay: PublishRelay<Timer>) {
let timerEditingViewController = TimerEditingViewController()
let timerEditingReactor = TimerEditingViewModel(
let timerEditingReactor = TimerEditingReactor(
initialTimer: initialTimer,
coordinator: self,
editedTimerRelay: editedTimerRelay
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// TimerCreateViewModel.swift
// TimerCreateReactor.swift
// Multimer
//
// Created by 김상혁 on 2022/12/21.
Expand All @@ -8,7 +8,7 @@
import ReactorKit
import RxRelay

final class TimerCreateViewModel: Reactor {
final class TimerCreateReactor: Reactor {

enum Action {
case cancelButtonDidTap
Expand Down Expand Up @@ -110,7 +110,7 @@ final class TimerCreateViewModel: Reactor {

// MARK: - Supporting Methods

private extension TimerCreateViewModel {
private extension TimerCreateReactor {
func validateCompleteButtonIsEnable(for timer: Timer) -> Bool {
let isNameEmpty = timer.name.isEmpty
let isTypeCountUp = timer.type == .countUp
Expand All @@ -122,7 +122,7 @@ private extension TimerCreateViewModel {

// MARK: - Side Effect Methods

private extension TimerCreateViewModel {
private extension TimerCreateReactor {
func exitScene() -> Observable<Mutation> {
coordinator?.coordinate(by: .finishTimerCreateScene)
return .empty()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ final class TimerCreateViewController: UIViewController, View {
layout()
}

func bind(reactor: TimerCreateViewModel) {
func bind(reactor: TimerCreateReactor) {
bindAction(reactor: reactor)
bindState(reactor: reactor)
}
Expand All @@ -105,7 +105,7 @@ final class TimerCreateViewController: UIViewController, View {
// MARK: - Bind Reactor

private extension TimerCreateViewController {
func bindAction(reactor: TimerCreateViewModel) {
func bindAction(reactor: TimerCreateReactor) {
timerTypeSegmentControl.rx.selectedSegmentIndex
.compactMap { TimerType(rawValue: $0) }
.map { Reactor.Action.timerTypeDidSelect($0) }
Expand Down Expand Up @@ -153,7 +153,7 @@ private extension TimerCreateViewController {
.disposed(by: disposeBag)
}

func bindState(reactor: TimerCreateViewModel) {
func bindState(reactor: TimerCreateReactor) {
reactor.state.map { $0.isCompleteButtonEnabled }
.distinctUntilChanged()
.bind(to: completeButton.rx.isEnabled)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// TimerEditingViewModel.swift
// TimerEditingReactor.swift
// Multimer
//
// Created by 김상혁 on 2022/11/07.
Expand All @@ -8,7 +8,7 @@
import ReactorKit
import RxRelay

final class TimerEditingViewModel: Reactor {
final class TimerEditingReactor: Reactor {

enum Action {
case cancelButtonDidTap
Expand Down Expand Up @@ -100,7 +100,7 @@ final class TimerEditingViewModel: Reactor {

// MARK: - Supporting Methods

private extension TimerEditingViewModel {
private extension TimerEditingReactor {
func validateCompleteButtonIsEnable(currentTimer: Timer, newTimer: Timer) -> Bool {
switch newTimer.type {
case .countDown:
Expand All @@ -113,7 +113,7 @@ private extension TimerEditingViewModel {

// MARK: - Side Effect Methods

private extension TimerEditingViewModel {
private extension TimerEditingReactor {
func exitScene() -> Observable<Mutation> {
coordinator?.coordinate(by: .finishTimerEditScene)
return .empty()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ final class TimerEditingViewController: UIViewController, View {
layout()
}

func bind(reactor: TimerEditingViewModel) {
func bind(reactor: TimerEditingReactor) {
bindAction(reactor: reactor)
bindState(reactor: reactor)
}
Expand All @@ -92,7 +92,7 @@ final class TimerEditingViewController: UIViewController, View {
// MARK: - Bind Reactor

private extension TimerEditingViewController {
func bindAction(reactor: TimerEditingViewModel) {
func bindAction(reactor: TimerEditingReactor) {
rx.viewDidLoad
.map { Reactor.Action.viewDidLoad }
.bind(to: reactor.action)
Expand Down Expand Up @@ -135,7 +135,7 @@ private extension TimerEditingViewController {
.disposed(by: disposeBag)
}

func bindState(reactor: TimerEditingViewModel) {
func bindState(reactor: TimerEditingReactor) {
reactor.state.map { $0.initialTimer }
.distinctUntilChanged()
.observe(on: MainScheduler.asyncInstance)
Expand Down

0 comments on commit a9ed860

Please sign in to comment.