Skip to content

Conversation

@thingineeer
Copy link
Collaborator

@thingineeer thingineeer commented Dec 13, 2023

🌱 작업한 내용

  1. 마라톤 Cell의 didSelectItemAt 수정 ⭐️
  2. 업로드 버튼 수정 ⭐️
  3. 페이지 네이션 ⭐️
  4. 코스 상세 삭제 이벤트 didRemoveCourse delegate 함수 추가
  5. 필요없는 파일 제거 (전체페이지를 불러오는 getTotalNum 관련 파일, mapCollectionView )
  6. 코스 상세에서 스크랩이 0일 때, 레이아웃에 안 보이게 수정
  7. 코스 상세에서 유저 프로필로 들어가는 터치 영역 스택 뷰로 수정
  8. 내가 그린 코스 제목 수정 ⭐️

🌱 PR Point

✅ 마라톤 Cell 부분의 didSelectItemAt

Combine으로 마라톤 Cell의 indexPath를 받아, CourseDiscoveryVC로 넘겨줘서, indexPath 해당하는 CourseDetailVC로 접근
을 하였습니다.
해당 부분에서 뷰 이동은 ViewController에서 해야 하기 때문에, Cell에서 CourseDetail로 넘겨주는 과정이 필요했습니다.
이 과정에서 "마라톤 코스"는 marathonCourseList[indexPath.item] 마라톤 코스 배열에서 가져와야 했기 때문에,
MarathonMapCollectionViewCell 의 속성인 marathonCourseListprivate 이 아닌 public으로 선언 하여 필요한 부분에 사용해주었습니다..

final class CourseDiscoveryVC: UIViewController {

    private func setCombineEvent() {
        CourseSelectionPublisher.shared.didSelectCourse
            .sink { [weak self] indexPath in
                self?.setMarathonCourseSelection(at: indexPath)
            }
            .store(in: cancelBag)
    }

{.....}

    private func setMarathonCourseSelection(at indexPath: IndexPath) {
        if let marathonCell = mapCollectionView.cellForItem(at: IndexPath(item: 0, section: Section.recommendedList)) as? MarathonMapCollectionViewCell {
            let marathonCourseList = marathonCell.marathonCourseList // ⭐️
            let courseDetailVC = CourseDetailVC()
            let courseModel = marathonCourseList[indexPath.item] // ⭐️
            courseDetailVC.setCourseId(courseId: courseModel.courseId, publicCourseId: courseModel.id)
            courseDetailVC.hidesBottomBarWhenPushed = true
            navigationController?.pushViewController(courseDetailVC, animated: true)
        }
    }

{.....}
}


✅ 업로드 버튼의 동적 속성

애니메이션 스터디를 하면서 쓸데없는 코드를 줄이고, 필요한 코드만 사용해서 애니메이션을 구현을 할 수 있다고 생각했습니다.
저번에 조금 헷갈리게 짠 로직은 전부 지웠습니다.
당근 마켓의 홈 탭 바의 글쓰기 버튼보다는 정교하진 않지만, 최대한 비슷하게 구현하였습니다.



✅ 페이지 네이션

  1. getCourseData 에서 매개변수 추가하였습니다. getCourseData(pageNo: Int)

  2. 페이지 네이션 로직의 순서를 바꾸었습니다. 원래 로직대로 하면 1페이지가 두번 호출
    아래는 수정한 부분

         if pageNo < totalPageNum {
                if !isDataLoaded {
                    isDataLoaded = true
                    print("🫠\(pageNo)")
                    self.pageNo += 1
                    getCourseData(pageNo: pageNo)
                    isDataLoaded = false
                }

✅ 내가 그린 코스 제목 수정 / 삭제 기능 구현

  1. 수정 작업 API 연결 완료
  2. 삭제 작업 완료

📮 관련 이슈

@thingineeer thingineeer requested a review from 513sojin December 13, 2023 12:50
@thingineeer thingineeer self-assigned this Dec 13, 2023
@thingineeer thingineeer added Feat 새로운 기능 구현 Refactor 전면 수정 labels Dec 13, 2023
courseList[indexPath.item] 를 가져왔기 때문에, 자연스럽지 못했는데 그 부분을 marathonCourseList로 바꾸어 해결 하였습니다.
course와 함께 전체 페이지를 보내는 API로 바뀌어서 필요없는 코드는 삭제 합니다.
@thingineeer thingineeer changed the title [Feat] #224 - 코스 발견 Event 처리 [Feat] #224 - 코스발견, 코스보관함, 코스 상세, 유저프로필 QA 진행 Dec 14, 2023
@thingineeer thingineeer changed the title [Feat] #224 - 코스발견, 코스보관함, 코스 상세, 유저프로필 QA 진행 [Feat] #224 - 코스발견, 코스보관함, 코스 상세, 유저프로필 1차 QA 진행 하였습니다. Dec 14, 2023
Comment on lines +375 to +376
self.pageNo += 1
getCourseData(pageNo: pageNo)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

순서 바뀐게 어떤 의미인가요

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Zep 으로 알려드리겠습니다~

@thingineeer thingineeer merged commit 0374a0d into Runnect:develop Dec 15, 2023
@thingineeer thingineeer deleted the #224---코스-발견-이벤트-처리-해결 branch December 15, 2023 11:42
@thingineeer thingineeer added UX and removed Feat 새로운 기능 구현 labels Oct 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Del 쓸모없는 코드, 주석 삭제 Refactor 전면 수정 UX 명진😼

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feat] #224 - 코스발견, 코스보관함, 코스 상세, 유저프로필 이슈

2 participants