Skip to content

Conversation

@GianmarcoFolchi
Copy link
Contributor

@GianmarcoFolchi GianmarcoFolchi commented Nov 18, 2025

Problem

When leadingScreensForBatching is set on ASCollectionNode or ASTableNode before the node loads, the value is not properly transferred to the underlying view. This causes the property to retain the default value of 2.0 instead of the configured value.

Root Cause

It looks like leadingScreensForBatching was accidentally omitted when transferring the pendingState to the view in the didLoad function.

Examples

Broken Example

- (instancetype)init {
    self = [super init];
    if (self) {
        _collectionNode = [[ASCollectionNode alloc] init...];
        _collectionNode.leadingScreensForBatching = 3.6;  // Stored in pending state but never transferred to view
        [self addSubnode:_collectionNode];
    }
    return self;
}

Result: leadingScreensForBatching stays at 2.0

Working Example

override func didLoadInternal() {
    let collectionView = collectionNode.view  // This triggers node load
    collectionNode.leadingScreensForBatching = 2.4  // Set after load, goes directly to view
}

Result: leadingScreensForBatching is correctly set to 2.4 since the view had already been loaded.

leadingScreensForBatching setter: leadingScreensForBatching goes to pendingState if it exists else it goes to the underlying view. The pendingState value wasn't being transferred to the underlying view on view creation.

- (void)setLeadingScreensForBatching:(CGFloat)leadingScreensForBatching
{
  if ([self pendingState]) {
    _pendingState.leadingScreensForBatching = leadingScreensForBatching;
  } else {
    ASDisplayNodeAssert([self isNodeLoaded], @"ASCollectionNode should be loaded if pendingState doesn't exist");
    self.view.leadingScreensForBatching = leadingScreensForBatching;
  }
}

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Gianmarco seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@GianmarcoFolchi GianmarcoFolchi force-pushed the gfolchi/leadingScreensForBatchingFix branch from e7aab67 to 1d63a8c Compare November 18, 2025 21:36
@rcancro rcancro merged commit 34de002 into TextureGroup:master Nov 19, 2025
2 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants