开发者

Swift TvOS: Overriding pressesBegan disables didSelectItemAt?

开发者 https://www.devze.com 2022-12-07 20:34 出处:网络
I was previously able to use the method didSelectItemAt for a collectionView, but ever since implementing a function override for pressesBegan in its corresponding cells, didSelectItemAt no longer see

I was previously able to use the method didSelectItemAt for a collectionView, but ever since implementing a function override for pressesBegan in its corresponding cells, didSelectItemAt no longer seems to be getting invoked.

func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
    // This used to work before overriding pressesBegan()...
}

The pressesBegan override in the correspond开发者_高级运维ing cell:

override func pressesBegan(_ presses: Set<UIPress>, with event: UIPressesEvent?) {
    super.pressesEnded(presses, with: event)
}

Are there adjustments I need to make so didSelectItemAt continues to work? Thanks.

0

精彩评论

暂无评论...
验证码 换一张
取 消