How can I customize the selection state of my UICollectionViewCell subclass?

前端 未结 5 1978
再見小時候
再見小時候 2021-02-01 04:02

I have a custom UICollectionViewCell subclass that overwrites initWithFrame: and layoutSubviews to setup its views. However, I\'m now trying to do two

5条回答
  •  一整个雨季
    2021-02-01 04:45

    Should not mess with state when overridden in this way:

    override var isSelected: Bool {
    
        get {
            return super.isSelected
        }
    
        set {
            super.isSelected = newValue
            .
            .
            .
        }
    }
    

提交回复
热议问题