From b6ae2ce41d5f57d4a923cf97f7a020fab85936ca Mon Sep 17 00:00:00 2001 From: Kwak Seong Joon Date: Sat, 22 Jul 2023 03:19:02 +0900 Subject: [PATCH] =?UTF-8?q?[Fix]=20=EC=A3=BC=EC=B0=A8=EB=B3=84=20=EB=A6=AC?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8=EB=B7=B0=20=EB=B6=81=EB=A7=88=ED=81=AC=20?= =?UTF-8?q?=EB=8D=B0=EC=9D=B4=ED=84=B0=20=EC=A0=84=EB=8B=AC=20indexPath.ro?= =?UTF-8?q?w=20=EA=B0=92=20=EB=B3=80=EA=B2=BD(#120)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Cells/CurriculumArticleByWeekTableViewCell.swift | 4 ++-- .../Cells/CurriculumListByWeekCollectionViewCell.swift | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/LionHeart-iOS/LionHeart-iOS/Scenes/Curriculum/Cells/CurriculumArticleByWeekTableViewCell.swift b/LionHeart-iOS/LionHeart-iOS/Scenes/Curriculum/Cells/CurriculumArticleByWeekTableViewCell.swift index f02409cc..da6d0185 100644 --- a/LionHeart-iOS/LionHeart-iOS/Scenes/Curriculum/Cells/CurriculumArticleByWeekTableViewCell.swift +++ b/LionHeart-iOS/LionHeart-iOS/Scenes/Curriculum/Cells/CurriculumArticleByWeekTableViewCell.swift @@ -93,9 +93,9 @@ final class CurriculumArticleByWeekTableViewCell: UITableViewCell, TableViewCell button.setImage(ImageLiterals.BookMark.activeBookmarkSmall, for: .selected) button.addButtonAction { _ in - let indexPath = self.getIndexPath() + guard var indexPath = self.getIndexPath() else { return } NotificationCenter.default.post(name: NSNotification.Name("isArticleBookmarked"), - object: nil, userInfo: ["bookmarkCellIndexPath": indexPath?.row ?? 0, + object: nil, userInfo: ["bookmarkCellIndexPath": indexPath.row-1, "bookmarkButtonSelected": !button.isSelected]) button.isSelected.toggle() } diff --git a/LionHeart-iOS/LionHeart-iOS/Scenes/Curriculum/Cells/CurriculumListByWeekCollectionViewCell.swift b/LionHeart-iOS/LionHeart-iOS/Scenes/Curriculum/Cells/CurriculumListByWeekCollectionViewCell.swift index 9229c45b..bbb17490 100644 --- a/LionHeart-iOS/LionHeart-iOS/Scenes/Curriculum/Cells/CurriculumListByWeekCollectionViewCell.swift +++ b/LionHeart-iOS/LionHeart-iOS/Scenes/Curriculum/Cells/CurriculumListByWeekCollectionViewCell.swift @@ -110,7 +110,7 @@ extension CurriculumListByWeekCollectionViewCell: UITableViewDataSource{ if indexPath.row == 0 { let cell = CurriculumArticleByWeekRowZeroTableViewCell.dequeueReusableCell(to: curriculumListByWeekTableView) - guard let weekCount else { return CurriculumTableViewCell() } +// guard let weekCount else { return CurriculumTableViewCell() } cell.inputData = inputData?.week return cell } else { @@ -129,7 +129,7 @@ extension CurriculumListByWeekCollectionViewCell: UITableViewDataSource{ } else { guard let inputData else { return } NotificationCenter.default.post(name: NSNotification.Name("didSelectTableViewCell"), - object: inputData.articleData[indexPath.row - 1].articleId) + object: inputData.articleData[indexPath.row-1].articleId) } }