huri000 / SwiftEntryKit

SwiftEntryKit is a presentation library for iOS. It can be used to easily display overlays within your iOS apps.
MIT License
6.63k stars 608 forks source link

collectionView didDeselectItemAt method not call #350

Closed JivanHuang closed 3 years ago

JivanHuang commented 3 years ago
let customView = QiInformationMoreView(frame:.zero);
        customView.delegate = self
        var attributes = EKAttributes.bottomFloat;
        attributes.screenBackground = .color(color: EKColor.init(.init(white: 0.0, alpha: 0.2)))
        attributes.positionConstraints.size = .init(
            width: .constant(value: screenWidth),
            height: .constant(value: autoWidth(230))
        )
        attributes.positionConstraints.safeArea = .overridden
        attributes.positionConstraints.verticalOffset = 0.0
        attributes.displayDuration = .infinity
        attributes.screenInteraction = .dismiss
        attributes.entryInteraction = .absorbTouches
        attributes.scroll = .disabled
        SwiftEntryKit.display(entry: customView, using: attributes)

func collectionView(_ collectionView: UICollectionView, didDeselectItemAt indexPath: IndexPath) {
        let item = moreItems[indexPath.item]
        delegate?.moreViewItemDidClick(moreView: self, item: item)
    }

I have initialized a custom view When I first click on the cell, the function didDeselectItemAt does not respond, and any subsequent clicks will respond to the previous event. This is a very strange bug,I guess it's a gesture problem.