AsyncDisplayKit icon indicating copy to clipboard operation
AsyncDisplayKit copied to clipboard

didSelectItemAt conflicts with nodeForItemAt in ASCollectionDelegate

Open rajeevwhiz opened this issue 10 years ago • 3 comments

Trying to implement select item in ASCollectionDelegate

func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
}

but getting this warning.

screen shot 2016-11-05 at 10 26 14 pm

I am not sure how to take care of the warning. If I make the function private or add @nonobjc, function is not called when a node is selected.

rajeevwhiz avatar Nov 06 '16 05:11 rajeevwhiz

If you want to use AS Components such ASCollectionView or ASCollectionNode you should implement the AS Delegates:

public func collectionNode(_ collectionNode: ASCollectionNode, didSelectItemAt indexPath: IndexPath)
    {
        // do something
    }

CR34L avatar Nov 08 '16 10:11 CR34L

Hi @rajeevwhiz, what version of ASDK do you use? If you use ASDK 2.0 the direct use of ASCollectionView is not suggested anymore and in fact methods are now deprecated. Please try to use ASColllectionNode instead.

maicki avatar Nov 08 '16 14:11 maicki

Moved to 2.0 and this is not an issue anymore

rajeevwhiz avatar Nov 08 '16 19:11 rajeevwhiz