From a2f40069c01aca2c4964aa1ce850e9b93327d7d1 Mon Sep 17 00:00:00 2001 From: yeonwoo Date: Thu, 12 Jan 2023 15:37:37 +0900 Subject: [PATCH] =?UTF-8?q?[Feat]=20#91=20-=20CourseSearchVC=20API=20?= =?UTF-8?q?=EC=97=B0=EA=B2=B0=20=EC=99=84=EB=A3=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CourseDiscovery/Views/VC/CourseSearchVC.swift | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/VC/CourseSearchVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/VC/CourseSearchVC.swift index c30221fb..80fc15bc 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/VC/CourseSearchVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/VC/CourseSearchVC.swift @@ -131,7 +131,7 @@ extension CourseSearchVC { extension CourseSearchVC: UICollectionViewDelegate, UICollectionViewDataSource { func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { return courseList.count - } + } func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: CourseListCVC.className, @@ -143,6 +143,15 @@ extension CourseSearchVC: UICollectionViewDelegate, UICollectionViewDataSource { cell.setData(imageURL: model.image, title: model.title, location: location, didLike: model.scarp) return cell } + func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { + + let courseDetailVC = CourseDetailVC() + let courseModel = courseList[indexPath.item] + courseDetailVC.setCourseId(courseId: courseModel.courseId, publicCourseId: courseModel.id) + courseDetailVC.hidesBottomBarWhenPushed = true + self.navigationController?.pushViewController(courseDetailVC, animated: true) + } + } // MARK: - UICollectionViewDelegateFlowLayout