Skip to content

Commit

Permalink
[Style] #471 - Rename properties
Browse files Browse the repository at this point in the history
  • Loading branch information
jim4020key committed Jul 24, 2023
1 parent 8b51a77 commit 6536aa1
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -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] {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ struct ExploreShortcutView: View {
VStack(spacing: 32) {
if isUpdateAnnnouncementShow {
Button {
viewModel.isShowingAnnouncement()
viewModel.announcementCellDidTap()
} label: {
AnnouncementCell(icon: "updateAppIcon",
tagName: TextLiteral.updateTag,
Expand Down Expand Up @@ -50,7 +50,7 @@ struct ExploreShortcutView: View {
Spacer()

Button {
viewModel.changeNumberOfCategories()
viewModel.changeDisplayedCategories()
} label: {
MoreCaptionTextView(text: viewModel.isCategoryCellViewFolded ? TextLiteral.categoryViewUnfold : TextLiteral.categoryViewFold)
}
Expand Down Expand Up @@ -95,7 +95,7 @@ struct ExploreShortcutView: View {
}
}
.navigationBarBackground ({ Color.shortcutsZipBackground })
.sheet(isPresented: $viewModel.isTappedAnnouncementCell) {
.sheet(isPresented: $viewModel.isAnnouncementCellShowing) {
UpdateInfoView()
.presentationDetents([.large])
.presentationDragIndicator(.visible)
Expand Down

0 comments on commit 6536aa1

Please sign in to comment.