Skip to content
This repository was archived by the owner on Feb 2, 2023. It is now read-only.

Commit 5d0a284

Browse files
committed
Merge pull request #407 from ianolito/fix-placeholder-api
Fix handling of pending nodes and placeholder layer
2 parents 8043e36 + 8699ab8 commit 5d0a284

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

AsyncDisplayKit/ASDisplayNode+Subclasses.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,8 @@
206206
* @abstract Indicates that the receiver is finished displaying its subnodes. This method is not called if there are
207207
* no subnodes present.
208208
*
209-
* @discussion Subclasses may override this method to be notified when subnode display (asynchronous or synchronous) is
210-
* about to begin.
209+
* @discussion Subclasses may override this method to be notified when subnode display (asynchronous or synchronous) has
210+
* completed.
211211
*/
212212
- (void)subnodeDisplayDidFinish:(ASDisplayNode *)subnode ASDISPLAYNODE_REQUIRES_SUPER;
213213

AsyncDisplayKit/ASDisplayNode.mm

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@ - (void)_initializeInstance
117117

118118
_displaySentinel = [[ASSentinel alloc] init];
119119

120+
_pendingDisplayNodes = [[NSMutableSet alloc] init];
121+
120122
_flags.isInHierarchy = NO;
121123
_flags.displaysAsynchronously = YES;
122124

@@ -1382,7 +1384,11 @@ - (void)displayWillStart
13821384
[_supernode subnodeDisplayWillStart:self];
13831385

13841386
if (_placeholderImage && _placeholderLayer && self.layer.contents == nil) {
1387+
[CATransaction begin];
1388+
[CATransaction setDisableActions:YES];
13851389
_placeholderLayer.contents = (id)_placeholderImage.CGImage;
1390+
_placeholderLayer.opacity = 1.0;
1391+
[CATransaction commit];
13861392
[self.layer addSublayer:_placeholderLayer];
13871393
}
13881394
}

0 commit comments

Comments
 (0)