Open chaneeii opened 2 years ago
extension CategoryCollectionView: UICollectionViewDelegateFlowLayout {
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
lazy var label: UILabel = {
$0.font = .systemFont(ofSize: 14)
$0.text = tagList[indexPath.item]
$0.sizeToFit()
return $0
}(UILabel())
let size = label.frame.size
return CGSize(width: size.width + 20, height: size.height + 12) // 여백을 준다
}
}
CollectionView에서 두 번째 touch로 선택해제 하기 : https://velog.io/@yongchul/CollectionView%EC%97%90%EC%84%9C-%EB%91%90-%EB%B2%88%EC%A7%B8-touch%EB%A1%9C-%EC%84%A0%ED%83%9D%ED%95%B4%EC%A0%9C-%ED%95%98%EA%B8%B0
CollectionViewCell의 selected, deselected 효과 구현 : https://velog.io/@yongchul/iOSCollectionViewCell%EC%9D%98-selected-deselected-%ED%9A%A8%EA%B3%BC-%EA%B5%AC%ED%98%84%ED%95%98%EA%B8%B0