facebookarchive / AsyncDisplayKit

Smooth asynchronous user interfaces for iOS apps.
http://asyncdisplaykit.org
Other
13.4k stars 2.2k forks source link

How to get ASCellNode location on ASCollectionNode #3357

Open abhigourking opened 3 years ago

abhigourking commented 3 years ago

Need to find the X, Y position of ASCellNode on the ASCollectionNode. cellnode.frame always returning 0 for X and Y position.

The frameInWindow property does but it is only for the debugging purpose and can not be accessible in code. // This should only be called for debugging. It's not thread safe and it doesn't assert. // NOTE: Returns CGRectNull if the node isn't in a hierarchy. - (CGRect)_frameInWindow

collectionNode.convert(cellNode.bounds, from: cellNode) Crashing the app Could not find a common ancestor between node1: cellNode and node2: <ASCollectionNode

collectionNode.convert(cellNode.bounds, from: nil) Returning some negative value

Anybody please help me out to find a solution. My requirement is to get the ASCellNode's Frame in respect to ASCellectionNode ie The Y position of frame should increase or decrease while scrolling the colllection node in (vertical layout).