mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Correct spelling errors
This commit is contained in:
@@ -51,7 +51,7 @@ typedef enum : NSUInteger {
|
|||||||
*
|
*
|
||||||
* With this property set to YES, the main thread will be blocked until display is complete for
|
* With this property set to YES, the main thread will be blocked until display is complete for
|
||||||
* the cell. This is more similar to UIKit, and in fact makes AsyncDisplayKit scrolling visually
|
* the cell. This is more similar to UIKit, and in fact makes AsyncDisplayKit scrolling visually
|
||||||
* indistinguishible from UIKit's, except being faster.
|
* indistinguishable from UIKit's, except being faster.
|
||||||
*
|
*
|
||||||
* Using this option does not eliminate all of the performance advantages of AsyncDisplayKit.
|
* Using this option does not eliminate all of the performance advantages of AsyncDisplayKit.
|
||||||
* Normally, a cell has been preloading and is almost done when it reaches the screen, so the
|
* Normally, a cell has been preloading and is almost done when it reaches the screen, so the
|
||||||
@@ -103,7 +103,7 @@ typedef enum : NSUInteger {
|
|||||||
* @param didLoadBlock The block that will be called after the view controller's view is loaded.
|
* @param didLoadBlock The block that will be called after the view controller's view is loaded.
|
||||||
*
|
*
|
||||||
* @return An ASCellNode created using the root view of the view controller provided by the viewControllerBlock.
|
* @return An ASCellNode created using the root view of the view controller provided by the viewControllerBlock.
|
||||||
* The view controller's root view is resized to match the calcuated size produced during layout.
|
* The view controller's root view is resized to match the calculated size produced during layout.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
- (instancetype)initWithViewControllerBlock:(ASDisplayNodeViewControllerBlock)viewControllerBlock didLoadBlock:(nullable ASDisplayNodeDidLoadBlock)didLoadBlock;
|
- (instancetype)initWithViewControllerBlock:(ASDisplayNodeViewControllerBlock)viewControllerBlock didLoadBlock:(nullable ASDisplayNodeDidLoadBlock)didLoadBlock;
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
/**
|
/**
|
||||||
* Tuning parameters for a range type in the specified mode.
|
* Tuning parameters for a range type in the specified mode.
|
||||||
*
|
*
|
||||||
* @param rangeMode The range mode to get the runing parameters for.
|
* @param rangeMode The range mode to get the running parameters for.
|
||||||
* @param rangeType The range type to get the tuning parameters for.
|
* @param rangeType The range type to get the tuning parameters for.
|
||||||
*
|
*
|
||||||
* @returns A tuning parameter value for the given range type in the given mode.
|
* @returns A tuning parameter value for the given range type in the given mode.
|
||||||
@@ -63,10 +63,10 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
- (ASRangeTuningParameters)tuningParametersForRangeMode:(ASLayoutRangeMode)rangeMode rangeType:(ASLayoutRangeType)rangeType;
|
- (ASRangeTuningParameters)tuningParametersForRangeMode:(ASLayoutRangeMode)rangeMode rangeType:(ASLayoutRangeType)rangeType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the tuning parameters for a range type in the specigied mode.
|
* Set the tuning parameters for a range type in the specified mode.
|
||||||
*
|
*
|
||||||
* @param tuningParameters The tuning parameters to store for a range type.
|
* @param tuningParameters The tuning parameters to store for a range type.
|
||||||
* @param rangeMode The range mode to set the runing parameters for.
|
* @param rangeMode The range mode to set the running parameters for.
|
||||||
* @param rangeType The range type to set the tuning parameters for.
|
* @param rangeType The range type to set the tuning parameters for.
|
||||||
*
|
*
|
||||||
* @see ASLayoutRangeMode
|
* @see ASLayoutRangeMode
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
/**
|
/**
|
||||||
* Tuning parameters for a range type in the specified mode.
|
* Tuning parameters for a range type in the specified mode.
|
||||||
*
|
*
|
||||||
* @param rangeMode The range mode to get the runing parameters for.
|
* @param rangeMode The range mode to get the running parameters for.
|
||||||
* @param rangeType The range type to get the tuning parameters for.
|
* @param rangeType The range type to get the tuning parameters for.
|
||||||
*
|
*
|
||||||
* @returns A tuning parameter value for the given range type in the given mode.
|
* @returns A tuning parameter value for the given range type in the given mode.
|
||||||
@@ -88,10 +88,10 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
- (ASRangeTuningParameters)tuningParametersForRangeMode:(ASLayoutRangeMode)rangeMode rangeType:(ASLayoutRangeType)rangeType;
|
- (ASRangeTuningParameters)tuningParametersForRangeMode:(ASLayoutRangeMode)rangeMode rangeType:(ASLayoutRangeType)rangeType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the tuning parameters for a range type in the specigied mode.
|
* Set the tuning parameters for a range type in the specified mode.
|
||||||
*
|
*
|
||||||
* @param tuningParameters The tuning parameters to store for a range type.
|
* @param tuningParameters The tuning parameters to store for a range type.
|
||||||
* @param rangeMode The range mode to set the runing parameters for.
|
* @param rangeMode The range mode to set the running parameters for.
|
||||||
* @param rangeType The range type to set the tuning parameters for.
|
* @param rangeType The range type to set the tuning parameters for.
|
||||||
*
|
*
|
||||||
* @see ASLayoutRangeMode
|
* @see ASLayoutRangeMode
|
||||||
@@ -396,7 +396,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicator to lock the data source for data fetching in async mode.
|
* Indicator to lock the data source for data fetching in async mode.
|
||||||
* We should not update the data source until the data source has been unlocked. Otherwise, it will incur data inconsistence or exception
|
* We should not update the data source until the data source has been unlocked. Otherwise, it will incur data inconsistency or exception
|
||||||
* due to the data access in async mode.
|
* due to the data access in async mode.
|
||||||
*
|
*
|
||||||
* @param collectionView The sender.
|
* @param collectionView The sender.
|
||||||
@@ -405,7 +405,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicator to unlock the data source for data fetching in async mode.
|
* Indicator to unlock the data source for data fetching in async mode.
|
||||||
* We should not update the data source until the data source has been unlocked. Otherwise, it will incur data inconsistence or exception
|
* We should not update the data source until the data source has been unlocked. Otherwise, it will incur data inconsistency or exception
|
||||||
* due to the data access in async mode.
|
* due to the data access in async mode.
|
||||||
*
|
*
|
||||||
* @param collectionView The sender.
|
* @param collectionView The sender.
|
||||||
|
|||||||
@@ -656,8 +656,8 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell";
|
|||||||
_ignoreMaxSizeChange = NO;
|
_ignoreMaxSizeChange = NO;
|
||||||
} else {
|
} else {
|
||||||
// This actually doesn't perform an animation, but prevents the transaction block from being processed in the
|
// This actually doesn't perform an animation, but prevents the transaction block from being processed in the
|
||||||
// data controller's prevent animation block that would interupt an interupted relayout happening in an animation block
|
// data controller's prevent animation block that would interrupt an interrupted relayout happening in an animation block
|
||||||
// ie. ASCollectionView bounds change on rotation or mutl-tasking split view resize.
|
// ie. ASCollectionView bounds change on rotation or multi-tasking split view resize.
|
||||||
[self performBatchAnimated:YES updates:^{
|
[self performBatchAnimated:YES updates:^{
|
||||||
[_dataController relayoutAllNodes];
|
[_dataController relayoutAllNodes];
|
||||||
} completion:nil];
|
} completion:nil];
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ extern NSString * const ASTransitionContextToLayoutKey;
|
|||||||
@protocol ASContextTransitioning <NSObject>
|
@protocol ASContextTransitioning <NSObject>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@abstreact Defines if the given transition is animated
|
@abstract Defines if the given transition is animated
|
||||||
*/
|
*/
|
||||||
- (BOOL)isAnimated;
|
- (BOOL)isAnimated;
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ typedef NS_OPTIONS(NSUInteger, ASControlState) {
|
|||||||
ASControlStateNormal = 0,
|
ASControlStateNormal = 0,
|
||||||
ASControlStateHighlighted = 1 << 0, // used when ASControlNode isHighlighted is set
|
ASControlStateHighlighted = 1 << 0, // used when ASControlNode isHighlighted is set
|
||||||
ASControlStateDisabled = 1 << 1,
|
ASControlStateDisabled = 1 << 1,
|
||||||
ASControlStateSelected = 1 << 2, // used when ASControlNode isSeleted is set
|
ASControlStateSelected = 1 << 2, // used when ASControlNode isSelected is set
|
||||||
ASControlStateReserved = 0xFF000000 // flags reserved for internal framework use
|
ASControlStateReserved = 0xFF000000 // flags reserved for internal framework use
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ _ASPendingState *ASDisplayNodeGetPendingState(ASDisplayNode *node)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns ASDisplayNodeFlags for the givern class/instance. instance MAY BE NIL.
|
* Returns ASDisplayNodeFlags for the given class/instance. instance MAY BE NIL.
|
||||||
*
|
*
|
||||||
* @param c the class, required
|
* @param c the class, required
|
||||||
* @param instance the instance, which may be nil. (If so, the class is inspected instead)
|
* @param instance the instance, which may be nil. (If so, the class is inspected instead)
|
||||||
@@ -131,7 +131,7 @@ static struct ASDisplayNodeFlags GetASDisplayNodeFlags(Class c, ASDisplayNode *i
|
|||||||
/**
|
/**
|
||||||
* Returns ASDisplayNodeMethodOverrides for the given class
|
* Returns ASDisplayNodeMethodOverrides for the given class
|
||||||
*
|
*
|
||||||
* @param c the class, requireed.
|
* @param c the class, required.
|
||||||
*
|
*
|
||||||
* @return ASDisplayNodeMethodOverrides.
|
* @return ASDisplayNodeMethodOverrides.
|
||||||
*/
|
*/
|
||||||
@@ -1528,7 +1528,7 @@ static NSInteger incrementIfFound(NSInteger i) {
|
|||||||
ASDisplayNodeAssertMainThread();
|
ASDisplayNodeAssertMainThread();
|
||||||
ASDisplayNodeAssert(!_flags.isEnteringHierarchy, @"Should not cause recursive __enterHierarchy");
|
ASDisplayNodeAssert(!_flags.isEnteringHierarchy, @"Should not cause recursive __enterHierarchy");
|
||||||
|
|
||||||
// Profiling has shown that locking this method is benificial, so each of the property accesses don't have to lock and unlock.
|
// Profiling has shown that locking this method is beneficial, so each of the property accesses don't have to lock and unlock.
|
||||||
ASDN::MutexLocker l(_propertyLock);
|
ASDN::MutexLocker l(_propertyLock);
|
||||||
|
|
||||||
if (!self.inHierarchy && !_flags.visibilityNotificationsDisabled && ![self __selfOrParentHasVisibilityNotificationsDisabled]) {
|
if (!self.inHierarchy && !_flags.visibilityNotificationsDisabled && ![self __selfOrParentHasVisibilityNotificationsDisabled]) {
|
||||||
@@ -1554,7 +1554,7 @@ static NSInteger incrementIfFound(NSInteger i) {
|
|||||||
ASDisplayNodeAssertMainThread();
|
ASDisplayNodeAssertMainThread();
|
||||||
ASDisplayNodeAssert(!_flags.isExitingHierarchy, @"Should not cause recursive __exitHierarchy");
|
ASDisplayNodeAssert(!_flags.isExitingHierarchy, @"Should not cause recursive __exitHierarchy");
|
||||||
|
|
||||||
// Profiling has shown that locking this method is benificial, so each of the property accesses don't have to lock and unlock.
|
// Profiling has shown that locking this method is beneficial, so each of the property accesses don't have to lock and unlock.
|
||||||
ASDN::MutexLocker l(_propertyLock);
|
ASDN::MutexLocker l(_propertyLock);
|
||||||
|
|
||||||
if (self.inHierarchy && !_flags.visibilityNotificationsDisabled && ![self __selfOrParentHasVisibilityNotificationsDisabled]) {
|
if (self.inHierarchy && !_flags.visibilityNotificationsDisabled && ![self __selfOrParentHasVisibilityNotificationsDisabled]) {
|
||||||
|
|||||||
@@ -75,10 +75,10 @@ extern ASDisplayNode * _Nullable ASViewToDisplayNode(UIView * _Nullable view);
|
|||||||
extern ASDisplayNode *ASDisplayNodeUltimateParentOfNode(ASDisplayNode *node);
|
extern ASDisplayNode *ASDisplayNodeUltimateParentOfNode(ASDisplayNode *node);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
This function will walk the layer heirarchy, spanning discontinuous sections of the node heirarchy (e.g. the layers
|
This function will walk the layer hierarchy, spanning discontinuous sections of the node hierarchy (e.g. the layers
|
||||||
of UIKit intermediate views in UIViewControllers, UITableView, UICollectionView).
|
of UIKit intermediate views in UIViewControllers, UITableView, UICollectionView).
|
||||||
In the event that a node's backing layer is not created yet, the function will only walk the direct subnodes instead
|
In the event that a node's backing layer is not created yet, the function will only walk the direct subnodes instead
|
||||||
of forcing the layer heirarchy to be created.
|
of forcing the layer hierarchy to be created.
|
||||||
*/
|
*/
|
||||||
extern void ASDisplayNodePerformBlockOnEveryNode(CALayer * _Nullable layer, ASDisplayNode * _Nullable node, void(^block)(ASDisplayNode *node));
|
extern void ASDisplayNodePerformBlockOnEveryNode(CALayer * _Nullable layer, ASDisplayNode * _Nullable node, void(^block)(ASDisplayNode *node));
|
||||||
|
|
||||||
@@ -109,7 +109,7 @@ extern id _Nullable ASDisplayNodeFindClass(ASDisplayNode *start, Class c);
|
|||||||
extern ASDisplayNode * _Nullable ASDisplayNodeFindClosestCommonAncestor(ASDisplayNode *node1, ASDisplayNode *node2);
|
extern ASDisplayNode * _Nullable ASDisplayNodeFindClosestCommonAncestor(ASDisplayNode *node1, ASDisplayNode *node2);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Given a display node, collects all descendents. This is a specialization of ASCollectContainer() that walks the Core Animation layer tree as opposed to the display node tree, thus supporting non-continues display node hierarchies.
|
Given a display node, collects all descendants. This is a specialization of ASCollectContainer() that walks the Core Animation layer tree as opposed to the display node tree, thus supporting non-continues display node hierarchies.
|
||||||
*/
|
*/
|
||||||
extern NSArray<ASDisplayNode *> *ASCollectDisplayNodes(ASDisplayNode *node);
|
extern NSArray<ASDisplayNode *> *ASCollectDisplayNodes(ASDisplayNode *node);
|
||||||
|
|
||||||
|
|||||||
@@ -155,9 +155,9 @@ extern __kindof ASDisplayNode * ASDisplayNodeFindFirstSubnodeOfClass(ASDisplayNo
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline BOOL _ASDisplayNodeIsAncestorOfDisplayNode(ASDisplayNode *possibleAncestor, ASDisplayNode *possibleDescendent)
|
static inline BOOL _ASDisplayNodeIsAncestorOfDisplayNode(ASDisplayNode *possibleAncestor, ASDisplayNode *possibleDescendant)
|
||||||
{
|
{
|
||||||
ASDisplayNode *supernode = possibleDescendent;
|
ASDisplayNode *supernode = possibleDescendant;
|
||||||
while (supernode) {
|
while (supernode) {
|
||||||
if (supernode == possibleAncestor) {
|
if (supernode == possibleAncestor) {
|
||||||
return YES;
|
return YES;
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
@abstract Indicates to the delegate that the text node's selection has changed.
|
@abstract Indicates to the delegate that the text node's selection has changed.
|
||||||
@param editableTextNode An editable text node.
|
@param editableTextNode An editable text node.
|
||||||
@param fromSelectedRange The previously selected range.
|
@param fromSelectedRange The previously selected range.
|
||||||
@param toSelectedRange The current selected range. Equvialent to the <selectedRange> property.
|
@param toSelectedRange The current selected range. Equivalent to the <selectedRange> property.
|
||||||
@param dueToEditing YES if the selection change was due to editing; NO otherwise.
|
@param dueToEditing YES if the selection change was due to editing; NO otherwise.
|
||||||
@discussion You can access the selection of the receiver via <selectedRange>.
|
@discussion You can access the selection of the receiver via <selectedRange>.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ typedef NS_ENUM(NSUInteger, ASMultiplexImageNodeErrorCode) {
|
|||||||
* @abstract ASMultiplexImageNode is an image node that can load and display multiple versions of an image. For
|
* @abstract ASMultiplexImageNode is an image node that can load and display multiple versions of an image. For
|
||||||
* example, it can display a low-resolution version of an image while the high-resolution version is loading.
|
* example, it can display a low-resolution version of an image while the high-resolution version is loading.
|
||||||
*
|
*
|
||||||
* @discussion ASMultiplexImageNode begins loading images when its <esource can either return a UIImage directly, or a URL the image node should load.
|
* @discussion ASMultiplexImageNode begins loading images when its resource can either return a UIImage directly, or a URL the image node should load.
|
||||||
*/
|
*/
|
||||||
@interface ASMultiplexImageNode : ASImageNode
|
@interface ASMultiplexImageNode : ASImageNode
|
||||||
|
|
||||||
@@ -99,7 +99,7 @@ typedef NS_ENUM(NSUInteger, ASMultiplexImageNodeErrorCode) {
|
|||||||
@property (nonatomic, readwrite, copy) NSArray<ASImageIdentifier> *imageIdentifiers;
|
@property (nonatomic, readwrite, copy) NSArray<ASImageIdentifier> *imageIdentifiers;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @abstract Notify the receiver SSAAthat its data source has new UIImages or NSURLs available for <imageIdentifiers>.
|
* @abstract Notify the receiver SSAA that its data source has new UIImages or NSURLs available for <imageIdentifiers>.
|
||||||
*
|
*
|
||||||
* @discussion If a higher-quality image than is currently displayed is now available, it will be loaded.
|
* @discussion If a higher-quality image than is currently displayed is now available, it will be loaded.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
- (void)setURL:(nullable NSURL *)URL resetToDefault:(BOOL)reset;
|
- (void)setURL:(nullable NSURL *)URL resetToDefault:(BOOL)reset;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If <URL> is a local file, set this property to YES to take advantage of UIKit's image cacheing. Defaults to YES.
|
* If <URL> is a local file, set this property to YES to take advantage of UIKit's image caching. Defaults to YES.
|
||||||
*/
|
*/
|
||||||
@property (nonatomic, assign, readwrite) BOOL shouldCacheImage;
|
@property (nonatomic, assign, readwrite) BOOL shouldCacheImage;
|
||||||
|
|
||||||
@@ -79,7 +79,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
#pragma mark -
|
#pragma mark -
|
||||||
/**
|
/**
|
||||||
* The methods declared by the ASNetworkImageNodeDelegate protocol allow the adopting delegate to respond to
|
* The methods declared by the ASNetworkImageNodeDelegate protocol allow the adopting delegate to respond to
|
||||||
* notifications such as fininished decoding and downloading an image.
|
* notifications such as finished decoding and downloading an image.
|
||||||
*/
|
*/
|
||||||
@protocol ASNetworkImageNodeDelegate <NSObject>
|
@protocol ASNetworkImageNodeDelegate <NSObject>
|
||||||
|
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
/**
|
/**
|
||||||
* Tuning parameters for a range type in the specified mode.
|
* Tuning parameters for a range type in the specified mode.
|
||||||
*
|
*
|
||||||
* @param rangeMode The range mode to get the runing parameters for.
|
* @param rangeMode The range mode to get the running parameters for.
|
||||||
* @param rangeType The range type to get the tuning parameters for.
|
* @param rangeType The range type to get the tuning parameters for.
|
||||||
*
|
*
|
||||||
* @returns A tuning parameter value for the given range type in the given mode.
|
* @returns A tuning parameter value for the given range type in the given mode.
|
||||||
@@ -92,10 +92,10 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
- (ASRangeTuningParameters)tuningParametersForRangeMode:(ASLayoutRangeMode)rangeMode rangeType:(ASLayoutRangeType)rangeType;
|
- (ASRangeTuningParameters)tuningParametersForRangeMode:(ASLayoutRangeMode)rangeMode rangeType:(ASLayoutRangeType)rangeType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the tuning parameters for a range type in the specigied mode.
|
* Set the tuning parameters for a range type in the specified mode.
|
||||||
*
|
*
|
||||||
* @param tuningParameters The tuning parameters to store for a range type.
|
* @param tuningParameters The tuning parameters to store for a range type.
|
||||||
* @param rangeMode The range mode to set the runing parameters for.
|
* @param rangeMode The range mode to set the running parameters for.
|
||||||
* @param rangeType The range type to set the tuning parameters for.
|
* @param rangeType The range type to set the tuning parameters for.
|
||||||
*
|
*
|
||||||
* @see ASLayoutRangeMode
|
* @see ASLayoutRangeMode
|
||||||
@@ -143,7 +143,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
* Concludes a series of method calls that insert, delete, select, or reload rows and sections of the table view, with animation enabled and no completion block.
|
* Concludes a series of method calls that insert, delete, select, or reload rows and sections of the table view, with animation enabled and no completion block.
|
||||||
* You call this method to bracket a series of method calls that begins with beginUpdates and that consists of operations
|
* You call this method to bracket a series of method calls that begins with beginUpdates and that consists of operations
|
||||||
* to insert, delete, select, and reload rows and sections of the table view. When you call endUpdates, ASTableView begins animating
|
* to insert, delete, select, and reload rows and sections of the table view. When you call endUpdates, ASTableView begins animating
|
||||||
* the operations simultaneously. This method is must be called from the main thread. It's important to remeber that the ASTableView will
|
* the operations simultaneously. This method is must be called from the main thread. It's important to remember that the ASTableView will
|
||||||
* be processing the updates asynchronously after this call is completed.
|
* be processing the updates asynchronously after this call is completed.
|
||||||
*/
|
*/
|
||||||
- (void)endUpdates;
|
- (void)endUpdates;
|
||||||
@@ -152,7 +152,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
* Concludes a series of method calls that insert, delete, select, or reload rows and sections of the table view.
|
* Concludes a series of method calls that insert, delete, select, or reload rows and sections of the table view.
|
||||||
* You call this method to bracket a series of method calls that begins with beginUpdates and that consists of operations
|
* You call this method to bracket a series of method calls that begins with beginUpdates and that consists of operations
|
||||||
* to insert, delete, select, and reload rows and sections of the table view. When you call endUpdates, ASTableView begins animating
|
* to insert, delete, select, and reload rows and sections of the table view. When you call endUpdates, ASTableView begins animating
|
||||||
* the operations simultaneously. This method is must be called from the main thread. It's important to remeber that the ASTableView will
|
* the operations simultaneously. This method is must be called from the main thread. It's important to remember that the ASTableView will
|
||||||
* be processing the updates asynchronously after this call and are not guaranteed to be reflected in the ASTableView until
|
* be processing the updates asynchronously after this call and are not guaranteed to be reflected in the ASTableView until
|
||||||
* the completion block is executed.
|
* the completion block is executed.
|
||||||
*
|
*
|
||||||
@@ -351,7 +351,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicator to lock the data source for data fetching in async mode.
|
* Indicator to lock the data source for data fetching in async mode.
|
||||||
* We should not update the data source until the data source has been unlocked. Otherwise, it will incur data inconsistence or exception
|
* We should not update the data source until the data source has been unlocked. Otherwise, it will incur data inconsistency or exception
|
||||||
* due to the data access in async mode.
|
* due to the data access in async mode.
|
||||||
*
|
*
|
||||||
* @param tableView The sender.
|
* @param tableView The sender.
|
||||||
@@ -360,7 +360,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicator to unlock the data source for data fetching in asyn mode.
|
* Indicator to unlock the data source for data fetching in asyn mode.
|
||||||
* We should not update the data source until the data source has been unlocked. Otherwise, it will incur data inconsistence or exception
|
* We should not update the data source until the data source has been unlocked. Otherwise, it will incur data inconsistency or exception
|
||||||
* due to the data access in async mode.
|
* due to the data access in async mode.
|
||||||
*
|
*
|
||||||
* @param tableView The sender.
|
* @param tableView The sender.
|
||||||
|
|||||||
@@ -493,7 +493,7 @@ static NSString * const kCellReuseIdentifier = @"_ASTableViewCell";
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)adjustContentOffsetWithNodes:(NSArray *)nodes atIndexPaths:(NSArray *)indexPaths inserting:(BOOL)inserting {
|
- (void)adjustContentOffsetWithNodes:(NSArray *)nodes atIndexPaths:(NSArray *)indexPaths inserting:(BOOL)inserting {
|
||||||
// Maintain the users visible window when inserting or deleteing cells by adjusting the content offset for nodes
|
// Maintain the users visible window when inserting or deleting cells by adjusting the content offset for nodes
|
||||||
// before the visible area. If in a begin/end updates block this will update _contentOffsetAdjustment, otherwise it will
|
// before the visible area. If in a begin/end updates block this will update _contentOffsetAdjustment, otherwise it will
|
||||||
// update self.contentOffset directly.
|
// update self.contentOffset directly.
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
@interface ASBatchContext : NSObject
|
@interface ASBatchContext : NSObject
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retreive the state of the current batch process.
|
* Retrieve the state of the current batch process.
|
||||||
*
|
*
|
||||||
* @returns A boolean reflecting if the owner of the context object is fetching another batch.
|
* @returns A boolean reflecting if the owner of the context object is fetching another batch.
|
||||||
*/
|
*/
|
||||||
@@ -44,7 +44,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
- (BOOL)batchFetchingWasCancelled;
|
- (BOOL)batchFetchingWasCancelled;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Notify the context object that something has interupted the batch fetching process.
|
* Notify the context object that something has interrupted the batch fetching process.
|
||||||
*
|
*
|
||||||
* @discussion Call this method only when something has corrupted the batch fetching process. Calling this method should
|
* @discussion Call this method only when something has corrupted the batch fetching process. Calling this method should
|
||||||
* be left to the owner of the batch process unless there is a specific purpose.
|
* be left to the owner of the batch process unless there is a specific purpose.
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ FOUNDATION_EXPORT NSString * const ASDataControllerRowNodeKind;
|
|||||||
* @discussion If enabled, we will fetch data through `dataController:nodeAtIndexPath:` and `dataController:rowsInSection:` in background thread.
|
* @discussion If enabled, we will fetch data through `dataController:nodeAtIndexPath:` and `dataController:rowsInSection:` in background thread.
|
||||||
* Otherwise, the methods will be invoked synchronically in calling thread. Enabling data fetching in async mode could avoid blocking main thread
|
* Otherwise, the methods will be invoked synchronically in calling thread. Enabling data fetching in async mode could avoid blocking main thread
|
||||||
* while allocating cell on main thread, which is frequently reported issue for handling large scale data. On another hand, the application code
|
* while allocating cell on main thread, which is frequently reported issue for handling large scale data. On another hand, the application code
|
||||||
* will take the responsibility to avoid data inconsistence. Specifically, we will lock the data source through `dataControllerLockDataSource`,
|
* will take the responsibility to avoid data inconsistency. Specifically, we will lock the data source through `dataControllerLockDataSource`,
|
||||||
* and unlock it by `dataControllerUnlockDataSource` after the data fetching. The application should not update the data source while
|
* and unlock it by `dataControllerUnlockDataSource` after the data fetching. The application should not update the data source while
|
||||||
* the data source is locked.
|
* the data source is locked.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ static void *kASSizingQueueContext = &kASSizingQueueContext;
|
|||||||
@interface ASDataController () {
|
@interface ASDataController () {
|
||||||
NSMutableArray *_externalCompletedNodes; // Main thread only. External data access can immediately query this if available.
|
NSMutableArray *_externalCompletedNodes; // Main thread only. External data access can immediately query this if available.
|
||||||
NSMutableDictionary *_completedNodes; // Main thread only. External data access can immediately query this if _externalCompletedNodes is unavailable.
|
NSMutableDictionary *_completedNodes; // Main thread only. External data access can immediately query this if _externalCompletedNodes is unavailable.
|
||||||
NSMutableDictionary *_editingNodes; // Modified on _editingTransactionQueue only. Updates propogated to _completedNodes.
|
NSMutableDictionary *_editingNodes; // Modified on _editingTransactionQueue only. Updates propagated to _completedNodes.
|
||||||
|
|
||||||
ASMainSerialQueue *_mainSerialQueue;
|
ASMainSerialQueue *_mainSerialQueue;
|
||||||
|
|
||||||
@@ -355,7 +355,7 @@ static void *kASSizingQueueContext = &kASSizingQueueContext;
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Inserts sections, represented as arrays, into the backing store at the given indicies and notifies the delegate.
|
* Inserts sections, represented as arrays, into the backing store at the given indices and notifies the delegate.
|
||||||
*
|
*
|
||||||
* @discussion The section arrays are inserted into the editing store, then a deep copy of the sections are inserted
|
* @discussion The section arrays are inserted into the editing store, then a deep copy of the sections are inserted
|
||||||
* in the completed store on the main thread. The delegate is invoked on the main thread.
|
* in the completed store on the main thread. The delegate is invoked on the main thread.
|
||||||
@@ -369,7 +369,7 @@ static void *kASSizingQueueContext = &kASSizingQueueContext;
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Removes sections at the given indicies from the backing store and notifies the delegate.
|
* Removes sections at the given indices from the backing store and notifies the delegate.
|
||||||
*
|
*
|
||||||
* @discussion Section array are first removed from the editing store, then the associated section in the completed
|
* @discussion Section array are first removed from the editing store, then the associated section in the completed
|
||||||
* store is removed on the main thread. The delegate is invoked on the main thread.
|
* store is removed on the main thread. The delegate is invoked on the main thread.
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ static UIApplicationState __ApplicationState = UIApplicationStateActive;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - Core visible node range managment API
|
#pragma mark - Core visible node range management API
|
||||||
|
|
||||||
+ (ASLayoutRangeMode)rangeModeForInterfaceState:(ASInterfaceState)interfaceState
|
+ (ASLayoutRangeMode)rangeModeForInterfaceState:(ASInterfaceState)interfaceState
|
||||||
currentRangeMode:(ASLayoutRangeMode)currentRangeMode
|
currentRangeMode:(ASLayoutRangeMode)currentRangeMode
|
||||||
|
|||||||
@@ -52,7 +52,7 @@
|
|||||||
|
|
||||||
@interface ASViewController (ASRangeControllerUpdateRangeProtocol)
|
@interface ASViewController (ASRangeControllerUpdateRangeProtocol)
|
||||||
|
|
||||||
/// Automatically adjust range mode based on view evenets if the containing node confirms to the ASRangeControllerUpdateRangeProtocol
|
/// Automatically adjust range mode based on view events if the containing node confirms to the ASRangeControllerUpdateRangeProtocol
|
||||||
@property (nonatomic, assign) BOOL automaticallyAdjustRangeModeBasedOnViewEvents;
|
@property (nonatomic, assign) BOOL automaticallyAdjustRangeModeBasedOnViewEvents;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
@@ -167,7 +167,7 @@ extern NSInteger const ASDefaultTransactionPriority;
|
|||||||
/**
|
/**
|
||||||
@summary Cancels all operations in the transaction.
|
@summary Cancels all operations in the transaction.
|
||||||
|
|
||||||
@desc You can only cancel a commmitted transaction.
|
@desc You can only cancel a committed transaction.
|
||||||
|
|
||||||
All completion blocks are always called, regardless of cancelation. Execution blocks may be skipped if canceled.
|
All completion blocks are always called, regardless of cancelation. Execution blocks may be skipped if canceled.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -236,7 +236,7 @@ void ASAsyncTransactionQueue::GroupImpl::schedule(NSInteger priority, dispatch_q
|
|||||||
operation._block();
|
operation._block();
|
||||||
}
|
}
|
||||||
operation._group->leave();
|
operation._group->leave();
|
||||||
operation._block = 0; // the block must be freed while mutex is unlocked
|
operation._block = nil; // the block must be freed while mutex is unlocked
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
--entry._threadCount;
|
--entry._threadCount;
|
||||||
@@ -484,7 +484,7 @@ ASAsyncTransactionQueue & ASAsyncTransactionQueue::instance()
|
|||||||
ASDisplayNodeAssert(_state != ASAsyncTransactionStateOpen, @"Transaction should not be open after committing group");
|
ASDisplayNodeAssert(_state != ASAsyncTransactionStateOpen, @"Transaction should not be open after committing group");
|
||||||
}
|
}
|
||||||
// If we needed to commit the group above, -completeTransaction may have already been run.
|
// If we needed to commit the group above, -completeTransaction may have already been run.
|
||||||
// It is designed to accomodate this by checking _state to ensure it is not complete.
|
// It is designed to accommodate this by checking _state to ensure it is not complete.
|
||||||
[self completeTransaction];
|
[self completeTransaction];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
+ (void)commit;
|
+ (void)commit;
|
||||||
|
|
||||||
/// Add a transaction container to be committed.
|
/// Add a transaction container to be committed.
|
||||||
/// @param containerLayer A layer containing a transaction to be commited. May or may not be a container layer.
|
/// @param containerLayer A layer containing a transaction to be committed. May or may not be a container layer.
|
||||||
/// @see ASAsyncTransactionContainer
|
/// @see ASAsyncTransactionContainer
|
||||||
- (void)addTransactionContainer:(CALayer *)containerLayer;
|
- (void)addTransactionContainer:(CALayer *)containerLayer;
|
||||||
@end
|
@end
|
||||||
|
|||||||
@@ -79,7 +79,7 @@
|
|||||||
MIN(size.height, (_sizingOptions & ASCenterLayoutSpecSizingOptionMinimumY) != 0 ? sublayout.size.height : size.height)
|
MIN(size.height, (_sizingOptions & ASCenterLayoutSpecSizingOptionMinimumY) != 0 ? sublayout.size.height : size.height)
|
||||||
});
|
});
|
||||||
|
|
||||||
// Compute the centered postion for the child
|
// Compute the centered position for the child
|
||||||
BOOL shouldCenterAlongX = (_centeringOptions & ASCenterLayoutSpecCenteringX);
|
BOOL shouldCenterAlongX = (_centeringOptions & ASCenterLayoutSpecCenteringX);
|
||||||
BOOL shouldCenterAlongY = (_centeringOptions & ASCenterLayoutSpecCenteringY);
|
BOOL shouldCenterAlongY = (_centeringOptions & ASCenterLayoutSpecCenteringY);
|
||||||
sublayout.position = {
|
sublayout.position = {
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ extern BOOL CGPointIsNull(CGPoint point);
|
|||||||
*
|
*
|
||||||
* @param size The size of this layout.
|
* @param size The size of this layout.
|
||||||
*
|
*
|
||||||
* @param position The posiion of this layout within its parent (if available).
|
* @param position The position of this layout within its parent (if available).
|
||||||
*
|
*
|
||||||
* @param sublayouts Sublayouts belong to the new layout.
|
* @param sublayouts Sublayouts belong to the new layout.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
* A store for all of the options defined by ASLayoutSpec subclasses. All implementors of ASLayoutable own a
|
* A store for all of the options defined by ASLayoutSpec subclasses. All implementors of ASLayoutable own a
|
||||||
* ASLayoutOptions. When certain layoutSpecs need option values, they are read from this class.
|
* ASLayoutOptions. When certain layoutSpecs need option values, they are read from this class.
|
||||||
*
|
*
|
||||||
* Unless you wish to create a custom layout spec, ASLayoutOptions can largerly be ignored. Instead you can access
|
* Unless you wish to create a custom layout spec, ASLayoutOptions can largely be ignored. Instead you can access
|
||||||
* the layout option properties exposed in ASLayoutable directly, which will set the values in ASLayoutOptions
|
* the layout option properties exposed in ASLayoutable directly, which will set the values in ASLayoutOptions
|
||||||
* behind the scenes.
|
* behind the scenes.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -10,7 +10,6 @@
|
|||||||
|
|
||||||
#import "ASLayoutOptionsPrivate.h"
|
#import "ASLayoutOptionsPrivate.h"
|
||||||
#import <AsyncDisplayKit/ASDisplayNodeInternal.h>
|
#import <AsyncDisplayKit/ASDisplayNodeInternal.h>
|
||||||
#import "ASThread.h"
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -21,7 +20,7 @@
|
|||||||
* create a define that allows us to easily implement the forwards in one place.
|
* create a define that allows us to easily implement the forwards in one place.
|
||||||
*
|
*
|
||||||
* If you create a custom layout spec, we recommend this stragety if you decide to extend
|
* If you create a custom layout spec, we recommend this stragety if you decide to extend
|
||||||
* ASDisplayNode and ASLAyoutSpec to provide convenience properties for any options that your
|
* ASDisplayNode and ASLayoutSpec to provide convenience properties for any options that your
|
||||||
* layoutSpec may require.
|
* layoutSpec may require.
|
||||||
*/
|
*/
|
||||||
#define ASLayoutOptionsForwarding \
|
#define ASLayoutOptionsForwarding \
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
* @param child A child to be added.
|
* @param child A child to be added.
|
||||||
*
|
*
|
||||||
* @discussion Every ASLayoutSpec must act on at least one child. The ASLayoutSpec base class takes the
|
* @discussion Every ASLayoutSpec must act on at least one child. The ASLayoutSpec base class takes the
|
||||||
* reponsibility of holding on to the spec children. Some layout specs, like ASInsetLayoutSpec,
|
* responsibility of holding on to the spec children. Some layout specs, like ASInsetLayoutSpec,
|
||||||
* only require a single child.
|
* only require a single child.
|
||||||
*
|
*
|
||||||
* For layout specs that require a known number of children (ASBackgroundLayoutSpec, for example)
|
* For layout specs that require a known number of children (ASBackgroundLayoutSpec, for example)
|
||||||
@@ -50,7 +50,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
* @param identifier An identifier associated with the child.
|
* @param identifier An identifier associated with the child.
|
||||||
*
|
*
|
||||||
* @discussion Every ASLayoutSpec must act on at least one child. The ASLayoutSpec base class takes the
|
* @discussion Every ASLayoutSpec must act on at least one child. The ASLayoutSpec base class takes the
|
||||||
* reponsibility of holding on to the spec children. Some layout specs, like ASInsetLayoutSpec,
|
* responsibility of holding on to the spec children. Some layout specs, like ASInsetLayoutSpec,
|
||||||
* only require a single child.
|
* only require a single child.
|
||||||
*
|
*
|
||||||
* For layout specs that require a known number of children (ASBackgroundLayoutSpec, for example)
|
* For layout specs that require a known number of children (ASBackgroundLayoutSpec, for example)
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
* These layout options are all stored in an ASLayoutOptions class (that is defined in ASLayoutablePrivate).
|
* These layout options are all stored in an ASLayoutOptions class (that is defined in ASLayoutablePrivate).
|
||||||
* Generally you needn't worry about the layout options class, as the layoutable protocols allow all direct
|
* Generally you needn't worry about the layout options class, as the layoutable protocols allow all direct
|
||||||
* access to the options via convenience properties. If you are creating custom layout spec, then you can
|
* access to the options via convenience properties. If you are creating custom layout spec, then you can
|
||||||
* extend the backing layout options class to accomodate any new layout options.
|
* extend the backing layout options class to accommodate any new layout options.
|
||||||
*/
|
*/
|
||||||
@protocol ASLayoutable <ASStackLayoutable, ASStaticLayoutable, ASLayoutablePrivate>
|
@protocol ASLayoutable <ASStackLayoutable, ASStaticLayoutable, ASLayoutablePrivate>
|
||||||
|
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ static void __ASDisplayLayerIncrementConcurrentDisplayCount(BOOL displayIsAsync,
|
|||||||
*/
|
*/
|
||||||
static void __ASDisplayLayerDecrementConcurrentDisplayCount(BOOL displayIsAsync, BOOL isRasterizing)
|
static void __ASDisplayLayerDecrementConcurrentDisplayCount(BOOL displayIsAsync, BOOL isRasterizing)
|
||||||
{
|
{
|
||||||
// Displays while rasterizing are not counted as concurrent displays, becuase they draw in serial when their rasterizing container displays.
|
// Displays while rasterizing are not counted as concurrent displays, because they draw in serial when their rasterizing container displays.
|
||||||
if (isRasterizing) {
|
if (isRasterizing) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -92,7 +92,7 @@ static void __ASDisplayLayerDecrementConcurrentDisplayCount(BOOL displayIsAsync,
|
|||||||
|
|
||||||
BOOL rasterizingFromAscendent = (_hierarchyState & ASHierarchyStateRasterized);
|
BOOL rasterizingFromAscendent = (_hierarchyState & ASHierarchyStateRasterized);
|
||||||
|
|
||||||
// if super node is rasterizing descendents, subnodes will not have had layout calls because they don't have layers
|
// if super node is rasterizing descendants, subnodes will not have had layout calls because they don't have layers
|
||||||
if (rasterizingFromAscendent) {
|
if (rasterizingFromAscendent) {
|
||||||
[self __layout];
|
[self __layout];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
NS_ASSUME_NONNULL_BEGIN
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Hierarchy state is propogated from nodes to all of their children when certain behaviors are required from the subtree.
|
Hierarchy state is propagated from nodes to all of their children when certain behaviors are required from the subtree.
|
||||||
Examples include rasterization and external driving of the .interfaceState property.
|
Examples include rasterization and external driving of the .interfaceState property.
|
||||||
By passing this information explicitly, performance is optimized by avoiding iteration up the supernode chain.
|
By passing this information explicitly, performance is optimized by avoiding iteration up the supernode chain.
|
||||||
Lastly, this avoidance of supernode traversal protects against the possibility of deadlocks when a supernode is
|
Lastly, this avoidance of supernode traversal protects against the possibility of deadlocks when a supernode is
|
||||||
@@ -41,9 +41,9 @@ typedef NS_OPTIONS(NSUInteger, ASHierarchyState)
|
|||||||
ASHierarchyStateRasterized = 1 << 0,
|
ASHierarchyStateRasterized = 1 << 0,
|
||||||
/** The node or one of its supernodes is managed by a class like ASRangeController. Most commonly, these nodes are
|
/** The node or one of its supernodes is managed by a class like ASRangeController. Most commonly, these nodes are
|
||||||
ASCellNode objects or a subnode of one, and are used in ASTableView or ASCollectionView.
|
ASCellNode objects or a subnode of one, and are used in ASTableView or ASCollectionView.
|
||||||
These nodes also recieve regular updates to the .interfaceState property with more detailed status information. */
|
These nodes also receive regular updates to the .interfaceState property with more detailed status information. */
|
||||||
ASHierarchyStateRangeManaged = 1 << 1,
|
ASHierarchyStateRangeManaged = 1 << 1,
|
||||||
/** Down-propogated version of _flags.visibilityNotificationsDisabled. This flag is very rarely set, but by having it
|
/** Down-propagated version of _flags.visibilityNotificationsDisabled. This flag is very rarely set, but by having it
|
||||||
locally available to nodes, they do not have to walk up supernodes at the critical points it is checked. */
|
locally available to nodes, they do not have to walk up supernodes at the critical points it is checked. */
|
||||||
ASHierarchyStateTransitioningSupernodes = 1 << 2,
|
ASHierarchyStateTransitioningSupernodes = 1 << 2,
|
||||||
/** One of the supernodes of this node is performing a transition.
|
/** One of the supernodes of this node is performing a transition.
|
||||||
@@ -93,9 +93,9 @@ inline BOOL ASHierarchyStateIncludesLayoutPending(ASHierarchyState hierarchyStat
|
|||||||
|
|
||||||
// The two methods below will eventually be exposed, but their names are subject to change.
|
// The two methods below will eventually be exposed, but their names are subject to change.
|
||||||
/**
|
/**
|
||||||
* @abstract Ensure that all rendering is complete for this node and its descendents.
|
* @abstract Ensure that all rendering is complete for this node and its descendants.
|
||||||
*
|
*
|
||||||
* @discussion Calling this method on the main thread after a node is added to the view heirarchy will ensure that
|
* @discussion Calling this method on the main thread after a node is added to the view hierarchy will ensure that
|
||||||
* placeholder states are never visible to the user. It is used by ASTableView, ASCollectionView, and ASViewController
|
* placeholder states are never visible to the user. It is used by ASTableView, ASCollectionView, and ASViewController
|
||||||
* to implement their respective ".neverShowPlaceholders" option.
|
* to implement their respective ".neverShowPlaceholders" option.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -302,7 +302,7 @@ if (shouldApply) { _layer.layerProperty = (layerValueExpr); } else { ASDisplayNo
|
|||||||
if (_hierarchyState & ASHierarchyStateRasterized) {
|
if (_hierarchyState & ASHierarchyStateRasterized) {
|
||||||
ASPerformBlockOnMainThread(^{
|
ASPerformBlockOnMainThread(^{
|
||||||
// The below operation must be performed on the main thread to ensure against an extremely rare deadlock, where a parent node
|
// The below operation must be performed on the main thread to ensure against an extremely rare deadlock, where a parent node
|
||||||
// begins materializing the view / layer heirarchy (locking itself or a descendant) while this node walks up
|
// begins materializing the view / layer hierarchy (locking itself or a descendant) while this node walks up
|
||||||
// the tree and requires locking that node to access .shouldRasterizeDescendants.
|
// the tree and requires locking that node to access .shouldRasterizeDescendants.
|
||||||
// For this reason, this method should be avoided when possible. Use _hierarchyState & ASHierarchyStateRasterized.
|
// For this reason, this method should be avoided when possible. Use _hierarchyState & ASHierarchyStateRasterized.
|
||||||
ASDisplayNodeAssertMainThread();
|
ASDisplayNodeAssertMainThread();
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ ASStackBaselinePositionedLayout ASStackBaselinePositionedLayout::compute(const A
|
|||||||
for each node is our computed maxAscender - node.ascender. If the 16pt node had an ascender of 10 and the 14pt node
|
for each node is our computed maxAscender - node.ascender. If the 16pt node had an ascender of 10 and the 14pt node
|
||||||
had an ascender of 8, that means we will offset the 14pt node by 2 pts.
|
had an ascender of 8, that means we will offset the 14pt node by 2 pts.
|
||||||
|
|
||||||
Note: if we are alinging to the last baseline, then we don't need this value in our computation. However, we do want
|
Note: if we are aligning to the last baseline, then we don't need this value in our computation. However, we do want
|
||||||
our layoutSpec to have it so that it can be baseline aligned with another text node or baseline layout spec.
|
our layoutSpec to have it so that it can be baseline aligned with another text node or baseline layout spec.
|
||||||
*/
|
*/
|
||||||
const auto ascenderIt = std::max_element(positionedLayout.sublayouts.begin(), positionedLayout.sublayouts.end(), [&](const ASLayout *a, const ASLayout *b){
|
const auto ascenderIt = std::max_element(positionedLayout.sublayouts.begin(), positionedLayout.sublayouts.end(), [&](const ASLayout *a, const ASLayout *b){
|
||||||
@@ -144,7 +144,7 @@ ASStackBaselinePositionedLayout ASStackBaselinePositionedLayout::compute(const A
|
|||||||
font size of 40 (max ascender). Now, we have to move the node with multiple lines down to the other node's baseline. This node with multiple lines will
|
font size of 40 (max ascender). Now, we have to move the node with multiple lines down to the other node's baseline. This node with multiple lines will
|
||||||
extend below the first node farther than it did before aligning the baselines thus increasing the cross size.
|
extend below the first node farther than it did before aligning the baselines thus increasing the cross size.
|
||||||
|
|
||||||
After finding the new cross size, we need to clamp it so that it fits within the constrainted size.
|
After finding the new cross size, we need to clamp it so that it fits within the constrained size.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
const auto it = std::max_element(stackedChildren.begin(), stackedChildren.end(),
|
const auto it = std::max_element(stackedChildren.begin(), stackedChildren.end(),
|
||||||
|
|||||||
@@ -46,7 +46,7 @@
|
|||||||
// mutable collection is still not safe while enumerating that way - which is one of the main uses for this method.
|
// mutable collection is still not safe while enumerating that way - which is one of the main uses for this method.
|
||||||
// A helper function called NSAllMapTableKeys() might do exactly what we want and should be more efficient, but unfortunately
|
// A helper function called NSAllMapTableKeys() might do exactly what we want and should be more efficient, but unfortunately
|
||||||
// is throwing a strange compiler error and may not be available in practice on the latest iOS version.
|
// is throwing a strange compiler error and may not be available in practice on the latest iOS version.
|
||||||
// Lastly, even -dictionaryRepresentation and then -allKeys won't work, because it attemps to copy the values of each key,
|
// Lastly, even -dictionaryRepresentation and then -allKeys won't work, because it attempts to copy the values of each key,
|
||||||
// which may not support copying (such as ASRangeControllers).
|
// which may not support copying (such as ASRangeControllers).
|
||||||
NSMutableArray *allObjects = [NSMutableArray array];
|
NSMutableArray *allObjects = [NSMutableArray array];
|
||||||
for (id object in _mapTable) {
|
for (id object in _mapTable) {
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ ASDISPLAYNODE_EXTERN_C_END
|
|||||||
- kCTParagraphStyleSpecifierMinimumLineSpacing
|
- kCTParagraphStyleSpecifierMinimumLineSpacing
|
||||||
- kCTParagraphStyleSpecifierLineSpacingAdjustment
|
- kCTParagraphStyleSpecifierLineSpacingAdjustment
|
||||||
- kCTParagraphStyleSpecifierLineBoundsOptions
|
- kCTParagraphStyleSpecifierLineBoundsOptions
|
||||||
@result An NSParagraphStyle initializd with as many of the paragraph specifiers from `coreTextParagraphStyle` as possible.
|
@result An NSParagraphStyle initialized with as many of the paragraph specifiers from `coreTextParagraphStyle` as possible.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
+ (instancetype)paragraphStyleWithCTParagraphStyle:(CTParagraphStyleRef)coreTextParagraphStyle;
|
+ (instancetype)paragraphStyleWithCTParagraphStyle:(CTParagraphStyleRef)coreTextParagraphStyle;
|
||||||
|
|||||||
@@ -62,7 +62,7 @@
|
|||||||
|
|
||||||
// We assume LTR so long as the writing direction is not
|
// We assume LTR so long as the writing direction is not
|
||||||
BOOL rtlWritingDirection = paragraphStyle ? paragraphStyle.baseWritingDirection == NSWritingDirectionRightToLeft : NO;
|
BOOL rtlWritingDirection = paragraphStyle ? paragraphStyle.baseWritingDirection == NSWritingDirectionRightToLeft : NO;
|
||||||
// We only want to treat the trunction rect as left-aligned in the case that we are right-aligned and our writing
|
// We only want to treat the truncation rect as left-aligned in the case that we are right-aligned and our writing
|
||||||
// direction is RTL.
|
// direction is RTL.
|
||||||
BOOL leftAligned = CGRectGetMinX(lastLineRect) == CGRectGetMinX(lastLineUsedRect) || !rtlWritingDirection;
|
BOOL leftAligned = CGRectGetMinX(lastLineRect) == CGRectGetMinX(lastLineUsedRect) || !rtlWritingDirection;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user