Skip to content

Commit

Permalink
feat/#388 약속 수정, 나가기 버튼 액션 구현 및 참여하지 않은 약속일 경우 준비 현황 버튼 못누르게 설정
Browse files Browse the repository at this point in the history
  • Loading branch information
youz2me committed Sep 20, 2024
1 parent f187bfb commit 79b1f6c
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,14 @@ private extension PromiseViewController {

toast.show(message: message, view: owner.view, position: .bottom, inset: 100)
}

viewModel.isExitSuccess.bindOnMain(with: self) { owner, isSuccess in
owner.navigationController?.popViewController(animated: true)
}

viewModel.isDeleteSuccess.bindOnMain(with: self) { owner, isSuccess in
owner.navigationController?.popViewController(animated: true)
}
}

@objc
Expand Down Expand Up @@ -226,9 +234,13 @@ private extension PromiseViewController {
extension PromiseViewController: CustomActionSheetDelegate {
func actionButtonDidTap(for kind: ActionSheetKind) {
if kind == .deletePromise {
viewModel.deletePromise()

dismiss(animated: false)
}
else {
viewModel.exitPromise()

dismiss(animated: false)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ extension ReadyStatusViewController {
$0.enterReadyButtonView.isHidden = owner.viewModel.isReadyInfoEntered()
$0.readyPlanInfoView.isHidden = !$0.enterReadyButtonView.isHidden
$0.enterReadyButtonView.isUserInteractionEnabled = isParticipant
$0.myReadyStatusProgressView.isUserInteractionEnabled = isParticipant
}
}

Expand Down
6 changes: 6 additions & 0 deletions KkuMulKum/Source/Promise/ViewModel/PromiseViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ class PromiseViewModel {
let participantList = ObservablePattern<[Participant]>([])
let tardyList = ObservablePattern<[Comer]>([])
let isFinishSuccess = ObservablePattern<Bool?>(nil)
let isDeleteSuccess = ObservablePattern<Bool?>(nil)
let isExitSuccess = ObservablePattern<Bool?>(nil)
let errorMessage = ObservablePattern<String?>(nil)

var pageControlDirection = false
Expand Down Expand Up @@ -359,6 +361,8 @@ extension PromiseViewModel {
print(">>>>> \(String(describing: result)) : \(#function)")
return
}

isDeleteSuccess.value = success
} catch {
print(">>>>> \(error.localizedDescription) : \(#function)")
}
Expand All @@ -377,6 +381,8 @@ extension PromiseViewModel {
print(">>>>> \(String(describing: result)) : \(#function)")
return
}

isExitSuccess.value = success
} catch {
print(">>>>> \(error.localizedDescription) : \(#function)")
}
Expand Down

0 comments on commit 79b1f6c

Please sign in to comment.