Skip to content

Commit

Permalink
Merge pull request #218 from yungu0010/feature/#217
Browse files Browse the repository at this point in the history
[Fix] #217 - 블로그 리뷰 셀 크기 변경
  • Loading branch information
L-j-h-c authored Jul 22, 2022
2 parents 2dc54d0 + 89f68de commit 1c413d8
Showing 1 changed file with 24 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ class ReviewDetailVC: UIViewController {
private var reviewData: [ReviewCellViewModel] = [] { didSet {
fetchCutStringList()
fetchExpendStateList()
reviewCV.reloadData()
}}
private var reviewServerData: [ReviewDataModel] = []
private var blogReviewData: [BlogReviewDataModel] = []
Expand Down Expand Up @@ -169,6 +168,29 @@ extension ReviewDetailVC {
return textView.frame.height
}

private func caculateBlogReviewHeight() -> CGFloat {
let textView = UITextView()
textView.text =
"""
"""
textView.font = .NotoRegular(size: 12)
textView.sizeToFit()
var contentHeight = textView.frame.height

let titleTextView = UITextView()
titleTextView.text = "제목"
titleTextView.font = .NotoBold(size: 14)
var titleHeight = titleTextView.frame.height

var totalHeight = titleHeight + contentHeight + 10 + 28 + 28

return totalHeight

}

private func addObserver() {
addObserverAction(.reviewPhotoClicked) { noti in
if let slideData = noti.object as? ImageSlideDataModel {
Expand Down Expand Up @@ -423,7 +445,6 @@ extension ReviewDetailVC: UICollectionViewDataSource {
} else if selectedCustomSegment == 1 {
URLSchemeManager.shared.loadSafariApp(blogLink: blogReviewData[indexPath.row].blogURL)
}

}
}

Expand Down Expand Up @@ -454,7 +475,7 @@ extension ReviewDetailVC: UICollectionViewDelegateFlowLayout {
return CGSize(width: cellWidth, height: cellHeight)
} else {
let cellWidth = width * 335/375
let cellHeight = cellWidth * 158/335
let cellHeight = caculateBlogReviewHeight()
return CGSize(width: cellWidth, height: cellHeight)
}
}
Expand Down

0 comments on commit 1c413d8

Please sign in to comment.