You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I recently posted an issue about a crash caused by #797 that has since been solved. However this same PR also had an undesirable effect on some of my ASCollectionNode layout and behaviour.
The original problem I had solved a long time ago was: "How to scroll to a given cell (or page, with isPagingEnabled) as soon as the data has been loaded?"
I remember asking this question on Slack and experimenting with several solutions including using reloadData, waitUntilAllUpdatesAreProcessed, etc. Eventually what was working 100% for me was something along the lines of:
override func interfaceStateDidChange(_ newState: ASInterfaceState, from oldState: ASInterfaceState) {
super.interfaceStateDidChange(newState, from: oldState)
if !oldState.contains(.inHierarchy), newState.contains(.inHierarchy), let index = self.preLoadIndex {
self.preLoadIndex = nil
self.collectionNode.scrollToItem(at: IndexPath(item: index, section: 0), at: [], animated: animated)
}
}
This was until #797, which introduces this change. Now some of my collection nodes no longer scroll to the correct index. Reverting this single line solves the problem for me, but I had two questions:
First of all, are there any other ways of reliably scrolling to a given cell as soon as the collection loads and is displayed? This might avoid finding a workaround/fix altogether.
Out of curiosity (and interest!) why was this change made? If the collection node is not part of a range managed hierarchy, why shouldn't the initial data load be triggered at this moment?
Hi guys,
I recently posted an issue about a crash caused by #797 that has since been solved. However this same PR also had an undesirable effect on some of my
ASCollectionNode
layout and behaviour.The original problem I had solved a long time ago was: "How to scroll to a given cell (or page, with
isPagingEnabled
) as soon as the data has been loaded?"I remember asking this question on Slack and experimenting with several solutions including using
reloadData
,waitUntilAllUpdatesAreProcessed
, etc. Eventually what was working 100% for me was something along the lines of:This was until #797, which introduces this change. Now some of my collection nodes no longer scroll to the correct index. Reverting this single line solves the problem for me, but I had two questions:
Maybe @appleguy could help me figure this out? 😊
Cheers,
The text was updated successfully, but these errors were encountered: