Skip to content

Commit 5b50346

Browse files
committed
refactor: MainViewCoordinator 뷰모델 이름 수정
1 parent e239de4 commit 5b50346

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

Application/DevLogPresentation/Sources/Main/MainView.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ struct MainView: View {
4545
}
4646
}
4747
.onAppear {
48-
coordinator.mainViewModel.send(.onAppear)
48+
coordinator.viewModel.send(.onAppear)
4949
}
5050
.onChange(of: selectedTab, initial: true) { _, newValue in
5151
guard let newValue else { return }
52-
coordinator.mainViewModel.send(.selectedTabChanged(newValue))
52+
coordinator.viewModel.send(.selectedTabChanged(newValue))
5353
if newValue == .home {
5454
homeViewCoordinator.fetchData()
5555
} else if newValue == .today {
@@ -61,12 +61,12 @@ struct MainView: View {
6161
}
6262
}
6363
.alert(
64-
coordinator.mainViewModel.state.alertTitle,
64+
coordinator.viewModel.state.alertTitle,
6565
isPresented: mainAlertPresented
6666
) {
6767
Button(String(localized: "common_close"), role: .cancel) { }
6868
} message: {
69-
Text(coordinator.mainViewModel.state.alertMessage)
69+
Text(coordinator.viewModel.state.alertMessage)
7070
}
7171
}
7272

@@ -88,7 +88,7 @@ struct MainView: View {
8888
.tabItem {
8989
tabLabel(.notification)
9090
}
91-
.badge(coordinator.mainViewModel.state.unreadPushCount)
91+
.badge(coordinator.viewModel.state.unreadPushCount)
9292
.tag(MainTab.notification as MainTab?)
9393

9494
profileView
@@ -191,7 +191,7 @@ struct MainView: View {
191191
private func sidebarRow(_ tab: MainTab) -> some View {
192192
if tab == .notification {
193193
tabLabel(tab)
194-
.badge(coordinator.mainViewModel.state.unreadPushCount)
194+
.badge(coordinator.viewModel.state.unreadPushCount)
195195
.tag(tab)
196196
} else {
197197
tabLabel(tab)
@@ -347,8 +347,8 @@ private extension MainView {
347347

348348
var mainAlertPresented: Binding<Bool> {
349349
Binding(
350-
get: { coordinator.mainViewModel.state.showAlert },
351-
set: { coordinator.mainViewModel.send(.setAlert($0)) }
350+
get: { coordinator.viewModel.state.showAlert },
351+
set: { coordinator.viewModel.send(.setAlert($0)) }
352352
)
353353
}
354354

Application/DevLogPresentation/Sources/Main/MainViewCoordinator.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ import DevLogDomain
1212
@MainActor
1313
@Observable
1414
final class MainViewCoordinator {
15-
let mainViewModel: MainViewModel
15+
let viewModel: MainViewModel
1616

1717
init(container: DIContainer) {
18-
self.mainViewModel = MainViewModel(
18+
self.viewModel = MainViewModel(
1919
trackAnalyticsEventUseCase: container.resolve(TrackAnalyticsEventUseCase.self),
2020
unreadPushCountUseCase: container.resolve(ObserveUnreadPushCountUseCase.self)
2121
)

0 commit comments

Comments
 (0)