diff --git a/Source/ASDisplayNode.h b/Source/ASDisplayNode.h index 964ddc50d..3e3d34001 100644 --- a/Source/ASDisplayNode.h +++ b/Source/ASDisplayNode.h @@ -20,6 +20,9 @@ #import #import +#pragma clang diagnostic push +#pragma clang diagnostic error "-Wobjc-missing-property-synthesis" + NS_ASSUME_NONNULL_BEGIN #define ASDisplayNodeLoggingEnabled 0 @@ -987,3 +990,5 @@ typedef NS_ENUM(NSInteger, ASLayoutEngineType) { @end NS_ASSUME_NONNULL_END + +#pragma clang diagnostic pop diff --git a/Source/ASDisplayNode.mm b/Source/ASDisplayNode.mm index 120282f18..c8115af49 100644 --- a/Source/ASDisplayNode.mm +++ b/Source/ASDisplayNode.mm @@ -2635,6 +2635,42 @@ - (BOOL)placeholderShouldPersist return NO; } +- (BOOL)placeholderEnabled +{ + MutexLocker l(__instanceLock__); + return _placeholderEnabled; +} + +- (void)setPlaceholderEnabled:(BOOL)placeholderEnabled +{ + MutexLocker l(__instanceLock__); + _placeholderEnabled = placeholderEnabled; +} + +- (NSTimeInterval)placeholderFadeDuration +{ + MutexLocker l(__instanceLock__); + return _placeholderFadeDuration; +} + +- (void)setPlaceholderFadeDuration:(NSTimeInterval)placeholderFadeDuration +{ + MutexLocker l(__instanceLock__); + _placeholderFadeDuration = placeholderFadeDuration; +} + +- (NSInteger)drawingPriority +{ + MutexLocker l(__instanceLock__); + return _drawingPriority; +} + +- (void)setDrawingPriority:(NSInteger)drawingPriority +{ + MutexLocker l(__instanceLock__); + _drawingPriority = drawingPriority; +} + #pragma mark - Hierarchy State - (BOOL)isInHierarchy diff --git a/Source/Private/ASDisplayNodeInternal.h b/Source/Private/ASDisplayNodeInternal.h index caf329ec7..b9b20cf8a 100644 --- a/Source/Private/ASDisplayNodeInternal.h +++ b/Source/Private/ASDisplayNodeInternal.h @@ -204,6 +204,9 @@ static constexpr CACornerMask kASCACornerAllCorners = UIImage *_placeholderImage; BOOL _placeholderEnabled; CALayer *_placeholderLayer; + NSTimeInterval _placeholderFadeDuration; + + NSInteger _drawingPriority; // keeps track of nodes/subnodes that have not finished display, used with placeholders ASWeakSet *_pendingDisplayNodes; @@ -351,20 +354,6 @@ static constexpr CACornerMask kASCACornerAllCorners = */ - (void)enumerateInterfaceStateDelegates:(void(NS_NOESCAPE ^)(id delegate))block; -/** - * // TODO: NOT YET IMPLEMENTED - * - * @abstract Prevents interface state changes from affecting the node, until disabled. - * - * @discussion Useful to avoid flashing after removing a node from the hierarchy and re-adding it. - * Removing a node from the hierarchy will cause it to exit the Display state, clearing its contents. - * For some animations, it's desirable to be able to remove a node without causing it to re-display. - * Once re-enabled, the interface state will be updated to the same value it would have been. - * - * @see ASInterfaceState - */ -@property (nonatomic) BOOL interfaceStateSuspended; - /** * This method has proven helpful in a few rare scenarios, similar to a category extension on UIView, * but it's considered private API for now and its use should not be encouraged.