Skip to content

Commit

Permalink
[#142] cell prepareForReuse 초기화 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
meenyweeny committed Aug 12, 2022
1 parent 1de6bd0 commit 14c755c
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ final class MessageCollectionViewCell: UICollectionViewCell {
fatalError("init(coder:) has not been implemented")
}

override func prepareForReuse() {
super.prepareForReuse()
initCell()
}

// MARK: - Custom Method

private func setUI() {
Expand All @@ -66,6 +71,13 @@ final class MessageCollectionViewCell: UICollectionViewCell {
}
}

private func initCell() {
contentLabel.text = ""
contentLabel.snp.remakeConstraints { make in
make.top.leading.trailing.equalToSuperview().inset(16)
}
}

private func adjustContentSize() {
contentLabel.setTextWithLineHeight(text: contentLabel.text, lineHeight: 16.8)
contentLabel.sizeToFit()
Expand Down

0 comments on commit 14c755c

Please sign in to comment.