chaneeii / iOS-Study-Log

✨ iOS에 대해 공부한 것들을 기록합니다 ✨
19 stars 0 forks source link

UICollectionView (컬렉션뷰) #24

Open chaneeii opened 2 years ago

chaneeii commented 2 years ago

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

chaneeii commented 2 years ago

Cell 에 컬렉션뷰 넣기

https://ios-development.tistory.com/991

https://fomaios.tistory.com/entry/iOS-%EC%BB%A4%EC%8A%A4%ED%85%80-XIB-UIView-%EC%A0%81%EC%9A%A9%ED%95%B4%EB%B3%B4%EA%B8%B0-Custom-XIB-UIView

chaneeii commented 2 years ago

VC 에 CollectionViews 넣기

https://youbidan-project.tistory.com/100

chaneeii commented 1 year ago

Cell 안에 padding 여백 동적으로 넣는법

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) // 여백을 준다
    }
}
스크린샷 2022-10-17 오전 10 45 37