From 6536aa1ede5a660397d20a5d1ae6f4b052cde018 Mon Sep 17 00:00:00 2001 From: jim4020key Date: Tue, 25 Jul 2023 07:49:49 +0900 Subject: [PATCH] [Style] #471 - Rename properties --- .../ExploreShortcutViewModel.swift | 16 ++++++++-------- .../ListCategoryShortcutViewModel.swift | 4 ++-- .../ListShortcutViewModel.swift | 4 ++-- .../ExploreShortcutView.swift | 6 +++--- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/HappyAnding/HappyAnding/ViewModel/ExploreShortcutViewModels/ExploreShortcutViewModel.swift b/HappyAnding/HappyAnding/ViewModel/ExploreShortcutViewModels/ExploreShortcutViewModel.swift index 9c6ebfb1..dca00d12 100644 --- a/HappyAnding/HappyAnding/ViewModel/ExploreShortcutViewModels/ExploreShortcutViewModel.swift +++ b/HappyAnding/HappyAnding/ViewModel/ExploreShortcutViewModels/ExploreShortcutViewModel.swift @@ -12,23 +12,23 @@ final class ExploreShortcutViewModel: ObservableObject { private let shortcutsZipViewModel = ShortcutsZipViewModel.share @Published private(set) var isCategoryCellViewFolded = true - @Published var isTappedAnnouncementCell = false + @Published var isAnnouncementCellShowing = false @Published private(set) var numberOfDisplayedCategories = 6 - func changeNumberOfCategories() { - isCategoryCellViewFolded.toggle() - numberOfDisplayedCategories = isCategoryCellViewFolded ? 6 : 12 + func changeDisplayedCategories() { + self.isCategoryCellViewFolded.toggle() + self.numberOfDisplayedCategories = isCategoryCellViewFolded ? 6 : 12 } - func isShowingAnnouncement() { - isTappedAnnouncementCell = true + func announcementCellDidTap() { + self.isAnnouncementCellShowing = true } func fetchShortcuts(by category: Category) -> [Shortcuts] { - shortcutsZipViewModel.shortcutsInCategory[category.index] + self.shortcutsZipViewModel.shortcutsInCategory[category.index] } func fetchShortcuts(by sectionType: SectionType) -> [Shortcuts] { - sectionType.filterShortcuts(from: shortcutsZipViewModel) + sectionType.filterShortcuts(from: self.shortcutsZipViewModel) } } diff --git a/HappyAnding/HappyAnding/ViewModel/ExploreShortcutViewModels/ListCategoryShortcutViewModel.swift b/HappyAnding/HappyAnding/ViewModel/ExploreShortcutViewModels/ListCategoryShortcutViewModel.swift index a90df18e..e029f62e 100644 --- a/HappyAnding/HappyAnding/ViewModel/ExploreShortcutViewModels/ListCategoryShortcutViewModel.swift +++ b/HappyAnding/HappyAnding/ViewModel/ExploreShortcutViewModels/ListCategoryShortcutViewModel.swift @@ -15,8 +15,8 @@ final class ListCategoryShortcutViewModel: ObservableObject { @Published private(set) var category: Category = .business init(data: Category) { - shortcuts = shortcutsZipViewModel.shortcutsInCategory[data.index] - category = data + self.shortcuts = shortcutsZipViewModel.shortcutsInCategory[data.index] + self.category = data } } diff --git a/HappyAnding/HappyAnding/ViewModel/ExploreShortcutViewModels/ListShortcutViewModel.swift b/HappyAnding/HappyAnding/ViewModel/ExploreShortcutViewModels/ListShortcutViewModel.swift index 187add77..06e1b292 100644 --- a/HappyAnding/HappyAnding/ViewModel/ExploreShortcutViewModels/ListShortcutViewModel.swift +++ b/HappyAnding/HappyAnding/ViewModel/ExploreShortcutViewModels/ListShortcutViewModel.swift @@ -15,8 +15,8 @@ final class ListShortcutViewModel: ObservableObject { @Published private(set) var sectionType: SectionType = .download init(data: SectionType) { - sectionType = data - shortcuts = fetchShortcutsBySectionType() + self.sectionType = data + self.shortcuts = fetchShortcutsBySectionType() } func fetchShortcutsBySectionType() -> [Shortcuts] { diff --git a/HappyAnding/HappyAnding/Views/ExploreShortcutViews/ExploreShortcutView.swift b/HappyAnding/HappyAnding/Views/ExploreShortcutViews/ExploreShortcutView.swift index bb96dbf2..39dd83be 100644 --- a/HappyAnding/HappyAnding/Views/ExploreShortcutViews/ExploreShortcutView.swift +++ b/HappyAnding/HappyAnding/Views/ExploreShortcutViews/ExploreShortcutView.swift @@ -22,7 +22,7 @@ struct ExploreShortcutView: View { VStack(spacing: 32) { if isUpdateAnnnouncementShow { Button { - viewModel.isShowingAnnouncement() + viewModel.announcementCellDidTap() } label: { AnnouncementCell(icon: "updateAppIcon", tagName: TextLiteral.updateTag, @@ -50,7 +50,7 @@ struct ExploreShortcutView: View { Spacer() Button { - viewModel.changeNumberOfCategories() + viewModel.changeDisplayedCategories() } label: { MoreCaptionTextView(text: viewModel.isCategoryCellViewFolded ? TextLiteral.categoryViewUnfold : TextLiteral.categoryViewFold) } @@ -95,7 +95,7 @@ struct ExploreShortcutView: View { } } .navigationBarBackground ({ Color.shortcutsZipBackground }) - .sheet(isPresented: $viewModel.isTappedAnnouncementCell) { + .sheet(isPresented: $viewModel.isAnnouncementCellShowing) { UpdateInfoView() .presentationDetents([.large]) .presentationDragIndicator(.visible)