♻️ 마이페이지 리스트뷰 리펙토링 - #295
Conversation
- 기존 UITableView DataSource 에서 Diffable DataSource 로 변경 작업 - 기존 2개(드랍, 좋아요)의 UITableView(Hidden 처리)를 1개의 UICollectionView를 이용한 개선 작업 - Compositional Layout 적용 - 콘텐츠 수에 따른 CollectionView Height 업데이트를 통한 전체 스크롤뷰 높이 조정
- 마이페이지 진입 시 Height 값과 이후 다른 탭(좋아요) 선택 후 Height 값(정상)이 달라 section 값 전달되고 선 호출 처리를 통해 임시 해결
…ew로 변경 작업 처리 - 기존 Diffable DataSource 로직 변경 없음 - Compositional Layout 제거
wendoei
left a comment
There was a problem hiding this comment.
고생하셨어요!! 돌아와서 같이 해결책 찾아볼게요!
|
tableView 로 바꾸기 직전 커밋(#294: 마이페이지 초기 진입할 때 2번 호출되는 이슈 처리 29cc826)에서 테스트 해보니
func updateCollectionViewHeight() {
DispatchQueue.main.async { [weak self] in
guard let self else { return }
let contentHeight = self.musicListCollectionView.contentSize.height
self.collectionViewHeightConstraint?.update(offset: max(contentHeight, 1))
}
}
output.myMusicsSections
.bind(with: self) { owner, sections in
// owner.updateCollectionViewHeight()
owner.displayMusicList(sections)
}
override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
updateCollectionViewHeight()
}결론은 말씀하신대로 전체를 collectionView 로 바꾸는게 가장 좋은 방법일 거 같아요..! |
많이 찾아보고 여러 시도를 해봤지만 정확한 이슈 원인 파악은 하지 못 했습니다ㅠ |
와..!! 지혜님 다 해서 확인해주시느라 고생 많으셨습니다ㅎㅎ
2번 이슈도 같은 방법으로 시도는 했었는데 호출을 너무 많이 해서 넘겼습니다.. |
📌 배경
close #294
내용
테스트 방법 (optional)
스크린샷 (optional)