From 0034f3f775a426654c85b88b5a463eec9c1eeb8c Mon Sep 17 00:00:00 2001 From: MinjaeLee <2alswo7@khu.ac.kr> Date: Tue, 3 Sep 2024 13:21:21 +0900 Subject: [PATCH 1/2] =?UTF-8?q?[Fix]=20#196=20-=20=EC=88=98=EC=A0=95?= =?UTF-8?q?=ED=95=98=EA=B8=B0=20=ED=81=B4=EB=A6=AD=20=EC=8B=9C=20"?= =?UTF-8?q?=EC=A0=84=EC=B2=B4"=EB=A1=9C=20=EB=A7=81=ED=81=AC=20=EB=AA=A9?= =?UTF-8?q?=EB=A1=9D=20=EC=B4=88=EA=B8=B0=ED=99=94=EB=90=98=EB=8D=98=20?= =?UTF-8?q?=EB=B2=84=EA=B7=B8=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../View/DetailClipViewController.swift | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/TOASTER-iOS/Present/DetailClip/View/DetailClipViewController.swift b/TOASTER-iOS/Present/DetailClip/View/DetailClipViewController.swift index 403cb55..cd079d7 100644 --- a/TOASTER-iOS/Present/DetailClip/View/DetailClipViewController.swift +++ b/TOASTER-iOS/Present/DetailClip/View/DetailClipViewController.swift @@ -157,21 +157,21 @@ extension DetailClipViewController: UICollectionViewDataSource { } else { cell.configureCell(forModel: viewModel.toastList, index: indexPath.item, isClipHidden: true) } - deleteLinkBottomSheetView.setupDeleteLinkBottomSheetButtonAction { - self.viewModel.deleteLinkAPI(toastId: self.viewModel.toastId) - self.dismiss(animated: true) { [weak self] in - self?.showToastMessage(width: 152, status: .check, message: StringLiterals.ToastMessage.completeDeleteLink) - } - } + + /// "수정하기" 클릭 시 deleteLinkBottomSheetView.setupEditLinkTitleBottomSheetButtonAction { - self.viewModel.getDetailCategoryAPI(categoryID: self.viewModel.categoryId, - filter: DetailCategoryFilter.all) self.dismiss(animated: true) { - self.viewModel.segmentIndex = indexPath.item - 1 self.editLinkBottom.setupSheetPresentation(bottomHeight: 198) self.present(self.editLinkBottom, animated: true) } } + /// "삭제" 클릭 시 + deleteLinkBottomSheetView.setupDeleteLinkBottomSheetButtonAction { + self.viewModel.deleteLinkAPI(toastId: self.viewModel.toastId) + self.dismiss(animated: true) { [weak self] in + self?.showToastMessage(width: 152, status: .check, message: StringLiterals.ToastMessage.completeDeleteLink) + } + } return cell } From f4b59d29d3b47972c035781566cdb8d3c33fdc70 Mon Sep 17 00:00:00 2001 From: MinjaeLee <2alswo7@khu.ac.kr> Date: Tue, 3 Sep 2024 13:42:38 +0900 Subject: [PATCH 2/2] =?UTF-8?q?[Fix]=20#196=20-=20=EC=A0=9C=EB=AA=A9=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=20=EC=8B=9C=20=EC=83=81=EB=8B=A8=20=ED=85=8D?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8=20"=EB=AF=B8=EC=97=B4=EB=9E=8C"=EC=9C=BC?= =?UTF-8?q?=EB=A1=9C=20=EB=B3=80=EA=B2=BD=EB=90=98=EB=8D=98=20=EB=B2=84?= =?UTF-8?q?=EA=B7=B8=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TOASTER-iOS/Network/Clip/ClipTargetType.swift | 2 +- .../Present/DetailClip/View/DetailClipViewController.swift | 6 ++++-- .../Present/DetailClip/ViewModel/DetailClipViewModel.swift | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/TOASTER-iOS/Network/Clip/ClipTargetType.swift b/TOASTER-iOS/Network/Clip/ClipTargetType.swift index de328ee..a6e80c7 100644 --- a/TOASTER-iOS/Network/Clip/ClipTargetType.swift +++ b/TOASTER-iOS/Network/Clip/ClipTargetType.swift @@ -9,7 +9,7 @@ import Foundation import Moya -enum DetailCategoryFilter: String { +enum DetailCategoryFilter: String, CaseIterable { case all = "ALL" case read = "READ" case unread = "UNREAD" diff --git a/TOASTER-iOS/Present/DetailClip/View/DetailClipViewController.swift b/TOASTER-iOS/Present/DetailClip/View/DetailClipViewController.swift index cd079d7..5445fc4 100644 --- a/TOASTER-iOS/Present/DetailClip/View/DetailClipViewController.swift +++ b/TOASTER-iOS/Present/DetailClip/View/DetailClipViewController.swift @@ -301,8 +301,10 @@ extension DetailClipViewController: EditLinkBottomSheetViewDelegate { extension DetailClipViewController: PatchClipDelegate { func patchEnd() { - viewModel.getDetailCategoryAPI(categoryID: self.viewModel.categoryId, - filter: DetailCategoryFilter.all) { + viewModel.getDetailCategoryAPI( + categoryID: self.viewModel.categoryId, + filter: DetailCategoryFilter.allCases[self.viewModel.segmentIndex] + ) { self.detailClipListCollectionView.reloadData() } } diff --git a/TOASTER-iOS/Present/DetailClip/ViewModel/DetailClipViewModel.swift b/TOASTER-iOS/Present/DetailClip/ViewModel/DetailClipViewModel.swift index 6b587ed..c965d22 100644 --- a/TOASTER-iOS/Present/DetailClip/ViewModel/DetailClipViewModel.swift +++ b/TOASTER-iOS/Present/DetailClip/ViewModel/DetailClipViewModel.swift @@ -22,7 +22,7 @@ final class DetailClipViewModel: NSObject { private var unAuthorizedAction: NormalChangeAction? private var editLinkTitleAction: NormalChangeAction? - weak var delegate: PatchClipDelegate? = nil + weak var delegate: PatchClipDelegate? // MARK: - Data