Skip to content

Commit

Permalink
[Feat] #51 - BasePickerViewModel 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
rafa-e1 committed Jan 18, 2025
1 parent 9f2fc52 commit b874a82
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
1 change: 1 addition & 0 deletions Memento-iOS/Memento-iOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
Source/Presentation/Add/AddSchedule/View/AddScheduleView.swift,
Source/Presentation/Add/AddSchedule/ViewModel/AddEventTitleViewModel.swift,
Source/Presentation/Add/Common/PickerButton/Model/PickerButtonType.swift,
Source/Presentation/Add/Common/PickerButton/ViewModel/BasePickerViewModel.swift,
Source/Presentation/Add/Common/Protocols/Presentable.swift,
Source/Presentation/Add/Common/SegmentedMenu/Model/SegmentedMenuType.swift,
Source/Presentation/Add/Common/SegmentedMenu/View/SegmentedMenuView.swift,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
//
// BasePickerViewModel.swift
// Memento-iOS
//
// Created by RAFA on 1/18/25.
//

import Foundation

class BasePickerViewModel: ObservableObject, Presentable {

@Published var isPresented: Bool = false
@Published var isPressed: Bool = false

func togglePresentation() {
isPresented.toggle()
isPressed = isPresented
}

func setPressedState(_ pressed: Bool) {
isPressed = pressed
}

func dismiss() {
isPresented = false
isPressed = false
}
}

0 comments on commit b874a82

Please sign in to comment.