mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
Add nullability annotations for public API
This commit is contained in:
@@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
#import <AsyncDisplayKit/ASDisplayNode.h>
|
#import <AsyncDisplayKit/ASDisplayNode.h>
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generic cell node. Subclass ASCellNode instead of <ASDisplayNode> to use <ASTableView>.
|
* Generic cell node. Subclass ASCellNode instead of <ASDisplayNode> to use <ASTableView>.
|
||||||
@@ -43,3 +44,5 @@
|
|||||||
@property (nonatomic, copy) NSString *text;
|
@property (nonatomic, copy) NSString *text;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
@@ -8,6 +8,8 @@
|
|||||||
|
|
||||||
#import <AsyncDisplayKit/AsyncDisplayKit.h>
|
#import <AsyncDisplayKit/AsyncDisplayKit.h>
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ASCollectionNode is a node based class that wraps an ASCollectionView. It can be used
|
* ASCollectionNode is a node based class that wraps an ASCollectionView. It can be used
|
||||||
* as a subnode of another node, and provide room for many (great) features and improvements later on.
|
* as a subnode of another node, and provide room for many (great) features and improvements later on.
|
||||||
@@ -19,3 +21,5 @@
|
|||||||
@property (nonatomic, readonly) ASCollectionView *view;
|
@property (nonatomic, readonly) ASCollectionView *view;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
- (instancetype)init
|
- (instancetype)init
|
||||||
{
|
{
|
||||||
ASDISPLAYNODE_NOT_DESIGNATED_INITIALIZER();
|
ASDISPLAYNODE_NOT_DESIGNATED_INITIALIZER();
|
||||||
self = [self initWithCollectionViewLayout:nil]; // Will throw an exception for lacking a UICV Layout.
|
self = [self initWithCollectionViewLayout:[UICollectionViewFlowLayout new]];
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
@protocol ASCollectionViewDataSource;
|
@protocol ASCollectionViewDataSource;
|
||||||
@protocol ASCollectionViewDelegate;
|
@protocol ASCollectionViewDelegate;
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Node-based collection view.
|
* Node-based collection view.
|
||||||
@@ -90,7 +91,7 @@
|
|||||||
* Boolean parameter that contains the value YES if all of the related animations completed successfully or
|
* Boolean parameter that contains the value YES if all of the related animations completed successfully or
|
||||||
* NO if they were interrupted. This parameter may be nil. If supplied, the block is run on the main thread.
|
* NO if they were interrupted. This parameter may be nil. If supplied, the block is run on the main thread.
|
||||||
*/
|
*/
|
||||||
- (void)performBatchAnimated:(BOOL)animated updates:(void (^)())updates completion:(void (^)(BOOL))completion;
|
- (void)performBatchAnimated:(BOOL)animated updates:(void (^ _Nullable)())updates completion:(void (^ _Nullable)(BOOL))completion;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Perform a batch of updates asynchronously. This method must be called from the main thread.
|
* Perform a batch of updates asynchronously. This method must be called from the main thread.
|
||||||
@@ -101,7 +102,7 @@
|
|||||||
* Boolean parameter that contains the value YES if all of the related animations completed successfully or
|
* Boolean parameter that contains the value YES if all of the related animations completed successfully or
|
||||||
* NO if they were interrupted. This parameter may be nil. If supplied, the block is run on the main thread.
|
* NO if they were interrupted. This parameter may be nil. If supplied, the block is run on the main thread.
|
||||||
*/
|
*/
|
||||||
- (void)performBatchUpdates:(void (^)())updates completion:(void (^)(BOOL))completion;
|
- (void)performBatchUpdates:(void (^ _Nullable)())updates completion:(void (^ _Nullable)(BOOL))completion;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reload everything from scratch, destroying the working range and all cached nodes.
|
* Reload everything from scratch, destroying the working range and all cached nodes.
|
||||||
@@ -110,7 +111,7 @@
|
|||||||
* the main thread.
|
* the main thread.
|
||||||
* @warning This method is substantially more expensive than UICollectionView's version.
|
* @warning This method is substantially more expensive than UICollectionView's version.
|
||||||
*/
|
*/
|
||||||
- (void)reloadDataWithCompletion:(void (^)())completion;
|
- (void)reloadDataWithCompletion:(void (^ _Nullable)())completion;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reload everything from scratch, destroying the working range and all cached nodes.
|
* Reload everything from scratch, destroying the working range and all cached nodes.
|
||||||
@@ -169,7 +170,7 @@
|
|||||||
* @discussion This method must be called from the main thread. The asyncDataSource must be updated to reflect the changes
|
* @discussion This method must be called from the main thread. The asyncDataSource must be updated to reflect the changes
|
||||||
* before this method is called.
|
* before this method is called.
|
||||||
*/
|
*/
|
||||||
- (void)insertItemsAtIndexPaths:(NSArray *)indexPaths;
|
- (void)insertItemsAtIndexPaths:(NSArray<NSIndexPath *> *)indexPaths;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deletes the items specified by an array of index paths.
|
* Deletes the items specified by an array of index paths.
|
||||||
@@ -179,7 +180,7 @@
|
|||||||
* @discussion This method must be called from the main thread. The asyncDataSource must be updated to reflect the changes
|
* @discussion This method must be called from the main thread. The asyncDataSource must be updated to reflect the changes
|
||||||
* before this method is called.
|
* before this method is called.
|
||||||
*/
|
*/
|
||||||
- (void)deleteItemsAtIndexPaths:(NSArray *)indexPaths;
|
- (void)deleteItemsAtIndexPaths:(NSArray<NSIndexPath *> *)indexPaths;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reloads the specified items.
|
* Reloads the specified items.
|
||||||
@@ -189,7 +190,7 @@
|
|||||||
* @discussion This method must be called from the main thread. The asyncDataSource must be updated to reflect the changes
|
* @discussion This method must be called from the main thread. The asyncDataSource must be updated to reflect the changes
|
||||||
* before this method is called.
|
* before this method is called.
|
||||||
*/
|
*/
|
||||||
- (void)reloadItemsAtIndexPaths:(NSArray *)indexPaths;
|
- (void)reloadItemsAtIndexPaths:(NSArray<NSIndexPath *> *)indexPaths;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Moves the item at a specified location to a destination location.
|
* Moves the item at a specified location to a destination location.
|
||||||
@@ -217,7 +218,7 @@
|
|||||||
*
|
*
|
||||||
* @returns an array containing the nodes being displayed on screen.
|
* @returns an array containing the nodes being displayed on screen.
|
||||||
*/
|
*/
|
||||||
- (NSArray *)visibleNodes;
|
- (NSArray<ASCellNode *> *)visibleNodes;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Query the sized node at `indexPath` for its calculatedSize.
|
* Query the sized node at `indexPath` for its calculatedSize.
|
||||||
@@ -303,7 +304,7 @@
|
|||||||
@optional
|
@optional
|
||||||
|
|
||||||
- (void)collectionView:(ASCollectionView *)collectionView willDisplayNodeForItemAtIndexPath:(NSIndexPath *)indexPath;
|
- (void)collectionView:(ASCollectionView *)collectionView willDisplayNodeForItemAtIndexPath:(NSIndexPath *)indexPath;
|
||||||
- (void)collectionView:(ASCollectionView *)collectionView didEndDisplayingNodeForItemAtIndexPath:(NSIndexPath*)indexPath;
|
- (void)collectionView:(ASCollectionView *)collectionView didEndDisplayingNodeForItemAtIndexPath:(NSIndexPath *)indexPath;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Receive a message that the collectionView is near the end of its data set and more data should be fetched if
|
* Receive a message that the collectionView is near the end of its data set and more data should be fetched if
|
||||||
@@ -353,3 +354,5 @@
|
|||||||
@property (nonatomic, assign) ASRangeTuningParameters rangeTuningParameters ASDISPLAYNODE_DEPRECATED;
|
@property (nonatomic, assign) ASRangeTuningParameters rangeTuningParameters ASDISPLAYNODE_DEPRECATED;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
#import <AsyncDisplayKit/ASControlNode.h>
|
#import <AsyncDisplayKit/ASControlNode.h>
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The subclass header _ASControlNode+Subclasses_ defines methods to be
|
* The subclass header _ASControlNode+Subclasses_ defines methods to be
|
||||||
@@ -24,7 +25,7 @@
|
|||||||
@param touchEvent An event object encapsulating the information specific to the user event.
|
@param touchEvent An event object encapsulating the information specific to the user event.
|
||||||
@discussion ASControlNode implements this method to send all action messages associated with controlEvents. The list of targets is constructed from prior invocations of addTarget:action:forControlEvents:.
|
@discussion ASControlNode implements this method to send all action messages associated with controlEvents. The list of targets is constructed from prior invocations of addTarget:action:forControlEvents:.
|
||||||
*/
|
*/
|
||||||
- (void)sendActionsForControlEvents:(ASControlNodeEvent)controlEvents withEvent:(UIEvent *)touchEvent;
|
- (void)sendActionsForControlEvents:(ASControlNodeEvent)controlEvents withEvent:(nullable UIEvent *)touchEvent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@abstract Sent to the control when tracking begins.
|
@abstract Sent to the control when tracking begins.
|
||||||
@@ -32,7 +33,7 @@
|
|||||||
@param touchEvent An event object encapsulating the information specific to the user event.
|
@param touchEvent An event object encapsulating the information specific to the user event.
|
||||||
@result YES if the receiver should respond continuously (respond when touch is dragged); NO otherwise.
|
@result YES if the receiver should respond continuously (respond when touch is dragged); NO otherwise.
|
||||||
*/
|
*/
|
||||||
- (BOOL)beginTrackingWithTouch:(UITouch *)touch withEvent:(UIEvent *)touchEvent;
|
- (BOOL)beginTrackingWithTouch:(UITouch *)touch withEvent:(nullable UIEvent *)touchEvent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@abstract Sent continuously to the control as it tracks a touch within the control's bounds.
|
@abstract Sent continuously to the control as it tracks a touch within the control's bounds.
|
||||||
@@ -40,20 +41,20 @@
|
|||||||
@param touchEvent An event object encapsulating the information specific to the user event.
|
@param touchEvent An event object encapsulating the information specific to the user event.
|
||||||
@result YES if touch tracking should continue; NO otherwise.
|
@result YES if touch tracking should continue; NO otherwise.
|
||||||
*/
|
*/
|
||||||
- (BOOL)continueTrackingWithTouch:(UITouch *)touch withEvent:(UIEvent *)touchEvent;
|
- (BOOL)continueTrackingWithTouch:(UITouch *)touch withEvent:(nullable UIEvent *)touchEvent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@abstract Sent to the control when tracking should be cancelled.
|
@abstract Sent to the control when tracking should be cancelled.
|
||||||
@param touchEvent An event object encapsulating the information specific to the user event. This parameter may be nil, indicating that the cancelation was caused by something other than an event, such as the display node being removed from its supernode.
|
@param touchEvent An event object encapsulating the information specific to the user event. This parameter may be nil, indicating that the cancelation was caused by something other than an event, such as the display node being removed from its supernode.
|
||||||
*/
|
*/
|
||||||
- (void)cancelTrackingWithEvent:(UIEvent *)touchEvent;
|
- (void)cancelTrackingWithEvent:(nullable UIEvent *)touchEvent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@abstract Sent to the control when the last touch completely ends, telling it to stop tracking.
|
@abstract Sent to the control when the last touch completely ends, telling it to stop tracking.
|
||||||
@param touch The touch that ended.
|
@param touch The touch that ended.
|
||||||
@param touchEvent An event object encapsulating the information specific to the user event.
|
@param touchEvent An event object encapsulating the information specific to the user event.
|
||||||
*/
|
*/
|
||||||
- (void)endTrackingWithTouch:(UITouch *)touch withEvent:(UIEvent *)touchEvent;
|
- (void)endTrackingWithTouch:(nullable UITouch *)touch withEvent:(nullable UIEvent *)touchEvent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@abstract Settable version of highlighted property.
|
@abstract Settable version of highlighted property.
|
||||||
@@ -61,3 +62,5 @@
|
|||||||
@property (nonatomic, readwrite, assign, getter=isHighlighted) BOOL highlighted;
|
@property (nonatomic, readwrite, assign, getter=isHighlighted) BOOL highlighted;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
@@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
#import <AsyncDisplayKit/ASDisplayNode.h>
|
#import <AsyncDisplayKit/ASDisplayNode.h>
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@abstract Kinds of events possible for control nodes.
|
@abstract Kinds of events possible for control nodes.
|
||||||
@@ -75,7 +76,7 @@ typedef NS_OPTIONS(NSUInteger, ASControlNodeEvent)
|
|||||||
@param controlEvents A bitmask specifying the control events for which the action message is sent. May not be 0. See "Control Events" for bitmask constants.
|
@param controlEvents A bitmask specifying the control events for which the action message is sent. May not be 0. See "Control Events" for bitmask constants.
|
||||||
@discussion You may call this method multiple times, and you may specify multiple target-action pairs for a particular event. Targets are held weakly.
|
@discussion You may call this method multiple times, and you may specify multiple target-action pairs for a particular event. Targets are held weakly.
|
||||||
*/
|
*/
|
||||||
- (void)addTarget:(id)target action:(SEL)action forControlEvents:(ASControlNodeEvent)controlEvents;
|
- (void)addTarget:(nullable id)target action:(SEL)action forControlEvents:(ASControlNodeEvent)controlEvents;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@abstract Returns the actions that are associated with a target and a particular control event.
|
@abstract Returns the actions that are associated with a target and a particular control event.
|
||||||
@@ -83,7 +84,7 @@ typedef NS_OPTIONS(NSUInteger, ASControlNodeEvent)
|
|||||||
@param controlEvent A single constant of type ASControlNodeEvent that specifies a particular user action on the control; for a list of these constants, see "Control Events". May not be 0 or ASControlNodeEventAllEvents.
|
@param controlEvent A single constant of type ASControlNodeEvent that specifies a particular user action on the control; for a list of these constants, see "Control Events". May not be 0 or ASControlNodeEventAllEvents.
|
||||||
@result An array of selector names as NSString objects, or nil if there are no action selectors associated with controlEvent.
|
@result An array of selector names as NSString objects, or nil if there are no action selectors associated with controlEvent.
|
||||||
*/
|
*/
|
||||||
- (NSArray *)actionsForTarget:(id)target forControlEvent:(ASControlNodeEvent)controlEvent;
|
- (nullable NSArray<NSString *> *)actionsForTarget:(id)target forControlEvent:(ASControlNodeEvent)controlEvent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@abstract Returns all target objects associated with the receiver.
|
@abstract Returns all target objects associated with the receiver.
|
||||||
@@ -97,13 +98,15 @@ typedef NS_OPTIONS(NSUInteger, ASControlNodeEvent)
|
|||||||
@param action A selector identifying an action message. Pass NULL to remove all action messages paired with target.
|
@param action A selector identifying an action message. Pass NULL to remove all action messages paired with target.
|
||||||
@param controlEvents A bitmask specifying the control events associated with target and action. See "Control Events" for bitmask constants. May not be 0.
|
@param controlEvents A bitmask specifying the control events associated with target and action. See "Control Events" for bitmask constants. May not be 0.
|
||||||
*/
|
*/
|
||||||
- (void)removeTarget:(id)target action:(SEL)action forControlEvents:(ASControlNodeEvent)controlEvents;
|
- (void)removeTarget:(nullable id)target action:(nullable SEL)action forControlEvents:(ASControlNodeEvent)controlEvents;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@abstract Sends the actions for the control events for a particular event.
|
@abstract Sends the actions for the control events for a particular event.
|
||||||
@param controlEvents A bitmask specifying the control events for which to send actions. See "Control Events" for bitmask constants. May not be 0.
|
@param controlEvents A bitmask specifying the control events for which to send actions. See "Control Events" for bitmask constants. May not be 0.
|
||||||
@param event The event which triggered these control actions. May be nil.
|
@param event The event which triggered these control actions. May be nil.
|
||||||
*/
|
*/
|
||||||
- (void)sendActionsForControlEvents:(ASControlNodeEvent)controlEvents withEvent:(UIEvent *)event;
|
- (void)sendActionsForControlEvents:(ASControlNodeEvent)controlEvents withEvent:(nullable UIEvent *)event;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
|
|||||||
@@ -15,6 +15,8 @@
|
|||||||
|
|
||||||
@class ASLayoutSpec;
|
@class ASLayoutSpec;
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The subclass header _ASDisplayNode+Subclasses_ defines the following methods that either must or can be overriden by
|
* The subclass header _ASDisplayNode+Subclasses_ defines the following methods that either must or can be overriden by
|
||||||
* subclasses of ASDisplayNode.
|
* subclasses of ASDisplayNode.
|
||||||
@@ -85,7 +87,7 @@
|
|||||||
*
|
*
|
||||||
* @warning Subclasses must not override this; it returns the last cached layout and is never expensive.
|
* @warning Subclasses must not override this; it returns the last cached layout and is never expensive.
|
||||||
*/
|
*/
|
||||||
@property (nonatomic, readonly, assign) ASLayout *calculatedLayout;
|
@property (nullable, nonatomic, readonly, assign) ASLayout *calculatedLayout;
|
||||||
|
|
||||||
/** @name View Lifecycle */
|
/** @name View Lifecycle */
|
||||||
|
|
||||||
@@ -208,7 +210,7 @@
|
|||||||
*
|
*
|
||||||
* @note Called on the display queue and/or main queue (MUST BE THREAD SAFE)
|
* @note Called on the display queue and/or main queue (MUST BE THREAD SAFE)
|
||||||
*/
|
*/
|
||||||
+ (UIImage *)displayWithParameters:(id<NSObject>)parameters
|
+ (nullable UIImage *)displayWithParameters:(id<NSObject>)parameters
|
||||||
isCancelled:(asdisplaynode_iscancelled_block_t)isCancelledBlock;
|
isCancelled:(asdisplaynode_iscancelled_block_t)isCancelledBlock;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -305,7 +307,7 @@
|
|||||||
* @param touches A set of UITouch instances.
|
* @param touches A set of UITouch instances.
|
||||||
* @param event A UIEvent associated with the touch.
|
* @param event A UIEvent associated with the touch.
|
||||||
*/
|
*/
|
||||||
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event;
|
- (void)touchesBegan:(NSSet *)touches withEvent:(nullable UIEvent *)event;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @abstract Tells the node when touches moved in its view.
|
* @abstract Tells the node when touches moved in its view.
|
||||||
@@ -313,7 +315,7 @@
|
|||||||
* @param touches A set of UITouch instances.
|
* @param touches A set of UITouch instances.
|
||||||
* @param event A UIEvent associated with the touch.
|
* @param event A UIEvent associated with the touch.
|
||||||
*/
|
*/
|
||||||
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event;
|
- (void)touchesMoved:(NSSet *)touches withEvent:(nullable UIEvent *)event;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @abstract Tells the node when touches ended in its view.
|
* @abstract Tells the node when touches ended in its view.
|
||||||
@@ -321,7 +323,7 @@
|
|||||||
* @param touches A set of UITouch instances.
|
* @param touches A set of UITouch instances.
|
||||||
* @param event A UIEvent associated with the touch.
|
* @param event A UIEvent associated with the touch.
|
||||||
*/
|
*/
|
||||||
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event;
|
- (void)touchesEnded:(NSSet *)touches withEvent:(nullable UIEvent *)event;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @abstract Tells the node when touches was cancelled in its view.
|
* @abstract Tells the node when touches was cancelled in its view.
|
||||||
@@ -329,7 +331,7 @@
|
|||||||
* @param touches A set of UITouch instances.
|
* @param touches A set of UITouch instances.
|
||||||
* @param event A UIEvent associated with the touch.
|
* @param event A UIEvent associated with the touch.
|
||||||
*/
|
*/
|
||||||
- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event;
|
- (void)touchesCancelled:(NSSet *)touches withEvent:(nullable UIEvent *)event;
|
||||||
|
|
||||||
|
|
||||||
/** @name Managing Gesture Recognizers */
|
/** @name Managing Gesture Recognizers */
|
||||||
@@ -359,7 +361,7 @@
|
|||||||
* 1) allows sending events to plain UIViews that don't have attached nodes,
|
* 1) allows sending events to plain UIViews that don't have attached nodes,
|
||||||
* 2) hitTest: is never called before the views are created.
|
* 2) hitTest: is never called before the views are created.
|
||||||
*/
|
*/
|
||||||
- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event;
|
- (UIView *)hitTest:(CGPoint)point withEvent:(nullable UIEvent *)event;
|
||||||
|
|
||||||
|
|
||||||
/** @name Observing node-related changes */
|
/** @name Observing node-related changes */
|
||||||
@@ -410,7 +412,7 @@
|
|||||||
*
|
*
|
||||||
* @note Called on the display queue and/or main queue (MUST BE THREAD SAFE)
|
* @note Called on the display queue and/or main queue (MUST BE THREAD SAFE)
|
||||||
*/
|
*/
|
||||||
- (UIImage *)placeholderImage;
|
- (nullable UIImage *)placeholderImage;
|
||||||
|
|
||||||
|
|
||||||
/** @name Description */
|
/** @name Description */
|
||||||
@@ -428,8 +430,10 @@
|
|||||||
@interface ASDisplayNode (ASDisplayNodePrivate)
|
@interface ASDisplayNode (ASDisplayNodePrivate)
|
||||||
// This method has proven helpful in a few rare scenarios, similar to a category extension on UIView,
|
// 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.
|
// but it's considered private API for now and its use should not be encouraged.
|
||||||
- (ASDisplayNode *)_supernodeWithClass:(Class)supernodeClass;
|
- (nullable ASDisplayNode *)_supernodeWithClass:(Class)supernodeClass;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
#define ASDisplayNodeAssertThreadAffinity(viewNode) ASDisplayNodeAssert(!viewNode || ASDisplayNodeThreadIsMain() || !(viewNode).nodeLoaded, @"Incorrect display node thread affinity")
|
#define ASDisplayNodeAssertThreadAffinity(viewNode) ASDisplayNodeAssert(!viewNode || ASDisplayNodeThreadIsMain() || !(viewNode).nodeLoaded, @"Incorrect display node thread affinity")
|
||||||
#define ASDisplayNodeCAssertThreadAffinity(viewNode) ASDisplayNodeCAssert(!viewNode || ASDisplayNodeThreadIsMain() || !(viewNode).nodeLoaded, @"Incorrect display node thread affinity")
|
#define ASDisplayNodeCAssertThreadAffinity(viewNode) ASDisplayNodeCAssert(!viewNode || ASDisplayNodeThreadIsMain() || !(viewNode).nodeLoaded, @"Incorrect display node thread affinity")
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
|
|||||||
@@ -15,17 +15,19 @@
|
|||||||
|
|
||||||
#import <AsyncDisplayKit/ASLayoutable.h>
|
#import <AsyncDisplayKit/ASLayoutable.h>
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
@class ASDisplayNode;
|
@class ASDisplayNode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* UIView creation block. Used to create the backing view of a new display node.
|
* UIView creation block. Used to create the backing view of a new display node.
|
||||||
*/
|
*/
|
||||||
typedef UIView *(^ASDisplayNodeViewBlock)();
|
typedef UIView * _Nonnull(^ASDisplayNodeViewBlock)();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* CALayer creation block. Used to create the backing layer of a new display node.
|
* CALayer creation block. Used to create the backing layer of a new display node.
|
||||||
*/
|
*/
|
||||||
typedef CALayer *(^ASDisplayNodeLayerBlock)();
|
typedef CALayer * _Nonnull(^ASDisplayNodeLayerBlock)();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ASDisplayNode loaded callback block. This block is called BEFORE the -didLoad method and is always called on the main thread.
|
* ASDisplayNode loaded callback block. This block is called BEFORE the -didLoad method and is always called on the main thread.
|
||||||
@@ -60,7 +62,7 @@ typedef void (^ASDisplayNodeDidLoadBlock)(ASDisplayNode *node);
|
|||||||
* @return An ASDisplayNode instance whose view will be a subclass that enables asynchronous rendering, and passes
|
* @return An ASDisplayNode instance whose view will be a subclass that enables asynchronous rendering, and passes
|
||||||
* through -layout and touch handling methods.
|
* through -layout and touch handling methods.
|
||||||
*/
|
*/
|
||||||
- (id)init;
|
- (instancetype)init;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -71,7 +73,7 @@ typedef void (^ASDisplayNodeDidLoadBlock)(ASDisplayNode *node);
|
|||||||
* @return An ASDisplayNode instance that loads its view with the given block that is guaranteed to run on the main
|
* @return An ASDisplayNode instance that loads its view with the given block that is guaranteed to run on the main
|
||||||
* queue. The view will render synchronously and -layout and touch handling methods on the node will not be called.
|
* queue. The view will render synchronously and -layout and touch handling methods on the node will not be called.
|
||||||
*/
|
*/
|
||||||
- (id)initWithViewBlock:(ASDisplayNodeViewBlock)viewBlock;
|
- (instancetype)initWithViewBlock:(ASDisplayNodeViewBlock)viewBlock;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @abstract Alternative initializer with a block to create the backing view.
|
* @abstract Alternative initializer with a block to create the backing view.
|
||||||
@@ -82,7 +84,7 @@ typedef void (^ASDisplayNodeDidLoadBlock)(ASDisplayNode *node);
|
|||||||
* @return An ASDisplayNode instance that loads its view with the given block that is guaranteed to run on the main
|
* @return An ASDisplayNode instance that loads its view with the given block that is guaranteed to run on the main
|
||||||
* queue. The view will render synchronously and -layout and touch handling methods on the node will not be called.
|
* queue. The view will render synchronously and -layout and touch handling methods on the node will not be called.
|
||||||
*/
|
*/
|
||||||
- (id)initWithViewBlock:(ASDisplayNodeViewBlock)viewBlock didLoadBlock:(ASDisplayNodeDidLoadBlock)didLoadBlock;
|
- (instancetype)initWithViewBlock:(ASDisplayNodeViewBlock)viewBlock didLoadBlock:(nullable ASDisplayNodeDidLoadBlock)didLoadBlock;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @abstract Alternative initializer with a block to create the backing layer.
|
* @abstract Alternative initializer with a block to create the backing layer.
|
||||||
@@ -92,7 +94,7 @@ typedef void (^ASDisplayNodeDidLoadBlock)(ASDisplayNode *node);
|
|||||||
* @return An ASDisplayNode instance that loads its layer with the given block that is guaranteed to run on the main
|
* @return An ASDisplayNode instance that loads its layer with the given block that is guaranteed to run on the main
|
||||||
* queue. The layer will render synchronously and -layout and touch handling methods on the node will not be called.
|
* queue. The layer will render synchronously and -layout and touch handling methods on the node will not be called.
|
||||||
*/
|
*/
|
||||||
- (id)initWithLayerBlock:(ASDisplayNodeLayerBlock)layerBlock;
|
- (instancetype)initWithLayerBlock:(ASDisplayNodeLayerBlock)layerBlock;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @abstract Alternative initializer with a block to create the backing layer.
|
* @abstract Alternative initializer with a block to create the backing layer.
|
||||||
@@ -103,7 +105,7 @@ typedef void (^ASDisplayNodeDidLoadBlock)(ASDisplayNode *node);
|
|||||||
* @return An ASDisplayNode instance that loads its layer with the given block that is guaranteed to run on the main
|
* @return An ASDisplayNode instance that loads its layer with the given block that is guaranteed to run on the main
|
||||||
* queue. The layer will render synchronously and -layout and touch handling methods on the node will not be called.
|
* queue. The layer will render synchronously and -layout and touch handling methods on the node will not be called.
|
||||||
*/
|
*/
|
||||||
- (id)initWithLayerBlock:(ASDisplayNodeLayerBlock)layerBlock didLoadBlock:(ASDisplayNodeDidLoadBlock)didLoadBlock;
|
- (instancetype)initWithLayerBlock:(ASDisplayNodeLayerBlock)layerBlock didLoadBlock:(nullable ASDisplayNodeDidLoadBlock)didLoadBlock;
|
||||||
|
|
||||||
|
|
||||||
/** @name Properties */
|
/** @name Properties */
|
||||||
@@ -295,7 +297,7 @@ typedef void (^ASDisplayNodeDidLoadBlock)(ASDisplayNode *node);
|
|||||||
/**
|
/**
|
||||||
* @abstract The receiver's immediate subnodes.
|
* @abstract The receiver's immediate subnodes.
|
||||||
*/
|
*/
|
||||||
@property (nonatomic, readonly, retain) NSArray *subnodes;
|
@property (nonatomic, readonly, retain) NSArray<ASDisplayNode *> *subnodes;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @abstract The receiver's supernode.
|
* @abstract The receiver's supernode.
|
||||||
@@ -454,7 +456,7 @@ typedef void (^ASDisplayNodeDidLoadBlock)(ASDisplayNode *node);
|
|||||||
*
|
*
|
||||||
* @return YES if point is inside the receiver's bounds; otherwise, NO.
|
* @return YES if point is inside the receiver's bounds; otherwise, NO.
|
||||||
*/
|
*/
|
||||||
- (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event;
|
- (BOOL)pointInside:(CGPoint)point withEvent:(nullable UIEvent *)event;
|
||||||
|
|
||||||
|
|
||||||
/** @name Converting Between View Coordinate Systems */
|
/** @name Converting Between View Coordinate Systems */
|
||||||
@@ -468,7 +470,7 @@ typedef void (^ASDisplayNodeDidLoadBlock)(ASDisplayNode *node);
|
|||||||
*
|
*
|
||||||
* @return The point converted to the coordinate system of node.
|
* @return The point converted to the coordinate system of node.
|
||||||
*/
|
*/
|
||||||
- (CGPoint)convertPoint:(CGPoint)point toNode:(ASDisplayNode *)node;
|
- (CGPoint)convertPoint:(CGPoint)point toNode:(nullable ASDisplayNode *)node;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -479,7 +481,7 @@ typedef void (^ASDisplayNodeDidLoadBlock)(ASDisplayNode *node);
|
|||||||
*
|
*
|
||||||
* @return The point converted to the local coordinate system (bounds) of the receiver.
|
* @return The point converted to the local coordinate system (bounds) of the receiver.
|
||||||
*/
|
*/
|
||||||
- (CGPoint)convertPoint:(CGPoint)point fromNode:(ASDisplayNode *)node;
|
- (CGPoint)convertPoint:(CGPoint)point fromNode:(nullable ASDisplayNode *)node;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -490,7 +492,7 @@ typedef void (^ASDisplayNodeDidLoadBlock)(ASDisplayNode *node);
|
|||||||
*
|
*
|
||||||
* @return The converted rectangle.
|
* @return The converted rectangle.
|
||||||
*/
|
*/
|
||||||
- (CGRect)convertRect:(CGRect)rect toNode:(ASDisplayNode *)node;
|
- (CGRect)convertRect:(CGRect)rect toNode:(nullable ASDisplayNode *)node;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @abstract Converts a rectangle from the coordinate system of another node to that of the receiver.
|
* @abstract Converts a rectangle from the coordinate system of another node to that of the receiver.
|
||||||
@@ -500,7 +502,7 @@ typedef void (^ASDisplayNodeDidLoadBlock)(ASDisplayNode *node);
|
|||||||
*
|
*
|
||||||
* @return The converted rectangle.
|
* @return The converted rectangle.
|
||||||
*/
|
*/
|
||||||
- (CGRect)convertRect:(CGRect)rect fromNode:(ASDisplayNode *)node;
|
- (CGRect)convertRect:(CGRect)rect fromNode:(nullable ASDisplayNode *)node;
|
||||||
|
|
||||||
/** @name UIResponder methods */
|
/** @name UIResponder methods */
|
||||||
|
|
||||||
@@ -510,7 +512,7 @@ typedef void (^ASDisplayNodeDidLoadBlock)(ASDisplayNode *node);
|
|||||||
- (BOOL)canResignFirstResponder; // default==YES
|
- (BOOL)canResignFirstResponder; // default==YES
|
||||||
- (BOOL)resignFirstResponder; // default==NO (no-op)
|
- (BOOL)resignFirstResponder; // default==NO (no-op)
|
||||||
- (BOOL)isFirstResponder;
|
- (BOOL)isFirstResponder;
|
||||||
- (BOOL)canPerformAction:(SEL)action withSender:(id)sender;
|
- (BOOL)canPerformAction:(SEL)action withSender:(nullable id)sender;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@@ -583,7 +585,7 @@ typedef void (^ASDisplayNodeDidLoadBlock)(ASDisplayNode *node);
|
|||||||
@property (atomic, assign) CGFloat contentsScale; // default=1.0f. See @contentsScaleForDisplay for more info
|
@property (atomic, assign) CGFloat contentsScale; // default=1.0f. See @contentsScaleForDisplay for more info
|
||||||
@property (atomic, assign) CATransform3D transform; // default=CATransform3DIdentity
|
@property (atomic, assign) CATransform3D transform; // default=CATransform3DIdentity
|
||||||
@property (atomic, assign) CATransform3D subnodeTransform; // default=CATransform3DIdentity
|
@property (atomic, assign) CATransform3D subnodeTransform; // default=CATransform3DIdentity
|
||||||
@property (atomic, copy) NSString *name; // default=nil. Use this to tag your layers in the server-recurse-description / pca or for your own purposes
|
@property (atomic, copy, nullable) NSString *name; // default=nil. Use this to tag your layers in the server-recurse-description / pca or for your own purposes
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @abstract The node view's background color.
|
* @abstract The node view's background color.
|
||||||
@@ -591,9 +593,9 @@ typedef void (^ASDisplayNodeDidLoadBlock)(ASDisplayNode *node);
|
|||||||
* @discussion In contrast to UIView, setting a transparent color will not set opaque = NO.
|
* @discussion In contrast to UIView, setting a transparent color will not set opaque = NO.
|
||||||
* This only affects nodes that implement +drawRect like ASTextNode.
|
* This only affects nodes that implement +drawRect like ASTextNode.
|
||||||
*/
|
*/
|
||||||
@property (atomic, retain) UIColor *backgroundColor; // default=nil
|
@property (atomic, retain, nullable) UIColor *backgroundColor; // default=nil
|
||||||
|
|
||||||
@property (atomic, retain) UIColor *tintColor; // default=Blue
|
@property (atomic, retain, null_resettable) UIColor *tintColor; // default=Blue
|
||||||
- (void)tintColorDidChange; // Notifies the node when the tintColor has changed.
|
- (void)tintColorDidChange; // Notifies the node when the tintColor has changed.
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -617,18 +619,18 @@ typedef void (^ASDisplayNodeDidLoadBlock)(ASDisplayNode *node);
|
|||||||
|
|
||||||
// Accessibility support
|
// Accessibility support
|
||||||
@property (atomic, assign) BOOL isAccessibilityElement;
|
@property (atomic, assign) BOOL isAccessibilityElement;
|
||||||
@property (atomic, copy) NSString *accessibilityLabel;
|
@property (nullable, atomic, copy) NSString *accessibilityLabel;
|
||||||
@property (atomic, copy) NSString *accessibilityHint;
|
@property (nullable, atomic, copy) NSString *accessibilityHint;
|
||||||
@property (atomic, copy) NSString *accessibilityValue;
|
@property (nullable, atomic, copy) NSString *accessibilityValue;
|
||||||
@property (atomic, assign) UIAccessibilityTraits accessibilityTraits;
|
@property (atomic, assign) UIAccessibilityTraits accessibilityTraits;
|
||||||
@property (atomic, assign) CGRect accessibilityFrame;
|
@property (atomic, assign) CGRect accessibilityFrame;
|
||||||
@property (atomic, retain) NSString *accessibilityLanguage;
|
@property (nullable, atomic, retain) NSString *accessibilityLanguage;
|
||||||
@property (atomic, assign) BOOL accessibilityElementsHidden;
|
@property (atomic, assign) BOOL accessibilityElementsHidden;
|
||||||
@property (atomic, assign) BOOL accessibilityViewIsModal;
|
@property (atomic, assign) BOOL accessibilityViewIsModal;
|
||||||
@property (atomic, assign) BOOL shouldGroupAccessibilityChildren;
|
@property (atomic, assign) BOOL shouldGroupAccessibilityChildren;
|
||||||
|
|
||||||
// Accessibility identification support
|
// Accessibility identification support
|
||||||
@property (nonatomic, copy) NSString *accessibilityIdentifier;
|
@property (nullable, nonatomic, copy) NSString *accessibilityIdentifier;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@@ -659,6 +661,7 @@ typedef void (^ASDisplayNodeDidLoadBlock)(ASDisplayNode *node);
|
|||||||
- (void)addSubnode:(ASDisplayNode *)node;
|
- (void)addSubnode:(ASDisplayNode *)node;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
||||||
@interface ASDisplayNode (Deprecated)
|
@interface ASDisplayNode (Deprecated)
|
||||||
|
|
||||||
- (void)reclaimMemory ASDISPLAYNODE_DEPRECATED;
|
- (void)reclaimMemory ASDISPLAYNODE_DEPRECATED;
|
||||||
@@ -666,3 +669,5 @@ typedef void (^ASDisplayNodeDidLoadBlock)(ASDisplayNode *node);
|
|||||||
@property (nonatomic, assign) BOOL placeholderFadesOut ASDISPLAYNODE_DEPRECATED;
|
@property (nonatomic, assign) BOOL placeholderFadesOut ASDISPLAYNODE_DEPRECATED;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
|
|||||||
@@ -12,22 +12,24 @@
|
|||||||
#import <AsyncDisplayKit/ASBaseDefines.h>
|
#import <AsyncDisplayKit/ASBaseDefines.h>
|
||||||
#import <AsyncDisplayKit/ASDisplayNode.h>
|
#import <AsyncDisplayKit/ASDisplayNode.h>
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
ASDISPLAYNODE_EXTERN_C_BEGIN
|
ASDISPLAYNODE_EXTERN_C_BEGIN
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Given a layer, returns the associated display node, if any.
|
Given a layer, returns the associated display node, if any.
|
||||||
*/
|
*/
|
||||||
extern ASDisplayNode *ASLayerToDisplayNode(CALayer *layer);
|
extern ASDisplayNode * _Nullable ASLayerToDisplayNode(CALayer * _Nullable layer);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Given a view, returns the associated display node, if any.
|
Given a view, returns the associated display node, if any.
|
||||||
*/
|
*/
|
||||||
extern ASDisplayNode *ASViewToDisplayNode(UIView *view);
|
extern ASDisplayNode * _Nullable ASViewToDisplayNode(UIView * _Nullable view);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Given a display node, traverses up the layer tree hierarchy, returning the first display node that passes block.
|
Given a display node, traverses up the layer tree hierarchy, returning the first display node that passes block.
|
||||||
*/
|
*/
|
||||||
extern id ASDisplayNodeFind(ASDisplayNode *node, BOOL (^block)(ASDisplayNode *node));
|
extern id ASDisplayNodeFind(ASDisplayNode * _Nullable node, BOOL (^block)(ASDisplayNode *node));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Given a display node, traverses up the layer tree hierarchy, returning the first display node of kind class.
|
Given a display node, traverses up the layer tree hierarchy, returning the first display node of kind class.
|
||||||
@@ -35,29 +37,29 @@ extern id ASDisplayNodeFind(ASDisplayNode *node, BOOL (^block)(ASDisplayNode *no
|
|||||||
extern id ASDisplayNodeFindClass(ASDisplayNode *start, Class c);
|
extern id ASDisplayNodeFindClass(ASDisplayNode *start, Class c);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
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 descendents. This is a specialization of ASCollectContainer() that walks the Core Animation layer tree as opposed to the display node tree, thus supporting non-continuous display node hierarchies.
|
||||||
*/
|
*/
|
||||||
extern NSArray *ASCollectDisplayNodes(ASDisplayNode *node);
|
extern NSArray<ASDisplayNode *> *ASCollectDisplayNodes(ASDisplayNode *node);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Given a display node, traverses down the node hierarchy, returning all the display nodes that pass the block.
|
Given a display node, traverses down the node hierarchy, returning all the display nodes that pass the block.
|
||||||
*/
|
*/
|
||||||
extern NSArray *ASDisplayNodeFindAllSubnodes(ASDisplayNode *start, BOOL (^block)(ASDisplayNode *node));
|
extern NSArray<ASDisplayNode *> *ASDisplayNodeFindAllSubnodes(ASDisplayNode *start, BOOL (^block)(ASDisplayNode *node));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Given a display node, traverses down the node hierarchy, returning all the display nodes of kind class.
|
Given a display node, traverses down the node hierarchy, returning all the display nodes of kind class.
|
||||||
*/
|
*/
|
||||||
extern NSArray *ASDisplayNodeFindAllSubnodesOfClass(ASDisplayNode *start, Class c);
|
extern NSArray<ASDisplayNode *> *ASDisplayNodeFindAllSubnodesOfClass(ASDisplayNode *start, Class c);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Given a display node, traverses down the node hierarchy, returning the depth-first display node that pass the block.
|
Given a display node, traverses down the node hierarchy, returning the depth-first display node that pass the block.
|
||||||
*/
|
*/
|
||||||
extern id ASDisplayNodeFindFirstSubnode(ASDisplayNode *start, BOOL (^block)(ASDisplayNode *node));
|
extern __kindof ASDisplayNode * ASDisplayNodeFindFirstSubnode(ASDisplayNode *start, BOOL (^block)(ASDisplayNode *node));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Given a display node, traverses down the node hierarchy, returning the depth-first display node of kind class.
|
Given a display node, traverses down the node hierarchy, returning the depth-first display node of kind class.
|
||||||
*/
|
*/
|
||||||
extern id ASDisplayNodeFindFirstSubnodeOfClass(ASDisplayNode *start, Class c);
|
extern __kindof ASDisplayNode * ASDisplayNodeFindFirstSubnodeOfClass(ASDisplayNode *start, Class c);
|
||||||
|
|
||||||
extern UIColor *ASDisplayNodeDefaultPlaceholderColor();
|
extern UIColor *ASDisplayNodeDefaultPlaceholderColor();
|
||||||
extern UIColor *ASDisplayNodeDefaultTintColor();
|
extern UIColor *ASDisplayNodeDefaultTintColor();
|
||||||
@@ -69,3 +71,5 @@ extern void ASDisplayNodeDisableHierarchyNotifications(ASDisplayNode *node);
|
|||||||
extern void ASDisplayNodeEnableHierarchyNotifications(ASDisplayNode *node);
|
extern void ASDisplayNodeEnableHierarchyNotifications(ASDisplayNode *node);
|
||||||
|
|
||||||
ASDISPLAYNODE_EXTERN_C_END
|
ASDISPLAYNODE_EXTERN_C_END
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
@@ -54,7 +54,7 @@ static void _ASCollectDisplayNodes(NSMutableArray *array, CALayer *layer)
|
|||||||
_ASCollectDisplayNodes(array, sublayer);
|
_ASCollectDisplayNodes(array, sublayer);
|
||||||
}
|
}
|
||||||
|
|
||||||
extern NSArray *ASCollectDisplayNodes(ASDisplayNode *node)
|
extern NSArray<ASDisplayNode *> *ASCollectDisplayNodes(ASDisplayNode *node)
|
||||||
{
|
{
|
||||||
NSMutableArray *list = [NSMutableArray array];
|
NSMutableArray *list = [NSMutableArray array];
|
||||||
for (CALayer *sublayer in node.layer.sublayers) {
|
for (CALayer *sublayer in node.layer.sublayers) {
|
||||||
@@ -79,14 +79,14 @@ static void _ASDisplayNodeFindAllSubnodes(NSMutableArray *array, ASDisplayNode *
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extern NSArray *ASDisplayNodeFindAllSubnodes(ASDisplayNode *start, BOOL (^block)(ASDisplayNode *node))
|
extern NSArray<ASDisplayNode *> *ASDisplayNodeFindAllSubnodes(ASDisplayNode *start, BOOL (^block)(ASDisplayNode *node))
|
||||||
{
|
{
|
||||||
NSMutableArray *list = [NSMutableArray array];
|
NSMutableArray *list = [NSMutableArray array];
|
||||||
_ASDisplayNodeFindAllSubnodes(list, start, block);
|
_ASDisplayNodeFindAllSubnodes(list, start, block);
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern NSArray *ASDisplayNodeFindAllSubnodesOfClass(ASDisplayNode *start, Class c)
|
extern NSArray<ASDisplayNode *> *ASDisplayNodeFindAllSubnodesOfClass(ASDisplayNode *start, Class c)
|
||||||
{
|
{
|
||||||
return ASDisplayNodeFindAllSubnodes(start, ^(ASDisplayNode *n) {
|
return ASDisplayNodeFindAllSubnodes(start, ^(ASDisplayNode *n) {
|
||||||
return [n isKindOfClass:c];
|
return [n isKindOfClass:c];
|
||||||
@@ -110,12 +110,12 @@ static ASDisplayNode *_ASDisplayNodeFindFirstSubnode(ASDisplayNode *startNode, B
|
|||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern id ASDisplayNodeFindFirstSubnode(ASDisplayNode *startNode, BOOL (^block)(ASDisplayNode *node))
|
extern __kindof ASDisplayNode * ASDisplayNodeFindFirstSubnode(ASDisplayNode *startNode, BOOL (^block)(ASDisplayNode *node))
|
||||||
{
|
{
|
||||||
return _ASDisplayNodeFindFirstSubnode(startNode, NO, block);
|
return _ASDisplayNodeFindFirstSubnode(startNode, NO, block);
|
||||||
}
|
}
|
||||||
|
|
||||||
extern id ASDisplayNodeFindFirstSubnodeOfClass(ASDisplayNode *start, Class c)
|
extern __kindof ASDisplayNode * ASDisplayNodeFindFirstSubnodeOfClass(ASDisplayNode *start, Class c)
|
||||||
{
|
{
|
||||||
return ASDisplayNodeFindFirstSubnode(start, ^(ASDisplayNode *n) {
|
return ASDisplayNodeFindFirstSubnode(start, ^(ASDisplayNode *n) {
|
||||||
return [n isKindOfClass:c];
|
return [n isKindOfClass:c];
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
#import <AsyncDisplayKit/ASDisplayNode.h>
|
#import <AsyncDisplayKit/ASDisplayNode.h>
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
@protocol ASEditableTextNodeDelegate;
|
@protocol ASEditableTextNodeDelegate;
|
||||||
|
|
||||||
@@ -26,7 +27,7 @@
|
|||||||
@property (nonatomic, readonly, strong) UITextView *textView;
|
@property (nonatomic, readonly, strong) UITextView *textView;
|
||||||
|
|
||||||
//! @abstract The attributes to apply to new text being entered by the user.
|
//! @abstract The attributes to apply to new text being entered by the user.
|
||||||
@property (nonatomic, readwrite, strong) NSDictionary *typingAttributes;
|
@property (nonatomic, readwrite, strong) NSDictionary<NSString *, id> *typingAttributes;
|
||||||
|
|
||||||
//! @abstract The range of text currently selected. If length is zero, the range is the cursor location.
|
//! @abstract The range of text currently selected. If length is zero, the range is the cursor location.
|
||||||
@property (nonatomic, readwrite, assign) NSRange selectedRange;
|
@property (nonatomic, readwrite, assign) NSRange selectedRange;
|
||||||
@@ -136,3 +137,5 @@
|
|||||||
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
@@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
#import <AsyncDisplayKit/ASControlNode.h>
|
#import <AsyncDisplayKit/ASControlNode.h>
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Image modification block. Use to transform an image before display.
|
* Image modification block. Use to transform an image before display.
|
||||||
@@ -32,12 +33,12 @@ typedef UIImage *(^asimagenode_modification_block_t)(UIImage *image);
|
|||||||
* the layer's contentsCenter property. Non-stretchable images work too, of
|
* the layer's contentsCenter property. Non-stretchable images work too, of
|
||||||
* course.
|
* course.
|
||||||
*/
|
*/
|
||||||
@property (atomic, retain) UIImage *image;
|
@property (nullable, atomic, retain) UIImage *image;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@abstract The placeholder color.
|
@abstract The placeholder color.
|
||||||
*/
|
*/
|
||||||
@property (nonatomic, strong) UIColor *placeholderColor;
|
@property (nullable, nonatomic, strong) UIColor *placeholderColor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @abstract Indicates whether efficient cropping of the receiver is enabled.
|
* @abstract Indicates whether efficient cropping of the receiver is enabled.
|
||||||
@@ -99,7 +100,7 @@ typedef UIImage *(^asimagenode_modification_block_t)(UIImage *image);
|
|||||||
* `displaySuspended` is YES, `displayCompletionBlock` is will be
|
* `displaySuspended` is YES, `displayCompletionBlock` is will be
|
||||||
* performed immediately and `YES` will be passed for `canceled`.
|
* performed immediately and `YES` will be passed for `canceled`.
|
||||||
*/
|
*/
|
||||||
- (void)setNeedsDisplayWithCompletion:(void (^)(BOOL canceled))displayCompletionBlock;
|
- (void)setNeedsDisplayWithCompletion:(void (^ _Nullable)(BOOL canceled))displayCompletionBlock;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@@ -131,3 +132,4 @@ asimagenode_modification_block_t ASImageNodeRoundBorderModificationBlock(CGFloat
|
|||||||
asimagenode_modification_block_t ASImageNodeTintColorModificationBlock(UIColor *color);
|
asimagenode_modification_block_t ASImageNodeTintColorModificationBlock(UIColor *color);
|
||||||
|
|
||||||
ASDISPLAYNODE_EXTERN_C_END
|
ASDISPLAYNODE_EXTERN_C_END
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
|
|||||||
@@ -260,7 +260,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark -
|
#pragma mark -
|
||||||
- (void)setNeedsDisplayWithCompletion:(void (^)(BOOL canceled))displayCompletionBlock
|
- (void)setNeedsDisplayWithCompletion:(void (^ _Nullable)(BOOL canceled))displayCompletionBlock
|
||||||
{
|
{
|
||||||
if (self.displaySuspended) {
|
if (self.displaySuspended) {
|
||||||
if (displayCompletionBlock)
|
if (displayCompletionBlock)
|
||||||
|
|||||||
@@ -9,10 +9,13 @@
|
|||||||
#import <AsyncDisplayKit/ASImageNode.h>
|
#import <AsyncDisplayKit/ASImageNode.h>
|
||||||
#import <AsyncDisplayKit/ASImageProtocols.h>
|
#import <AsyncDisplayKit/ASImageProtocols.h>
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
@protocol ASMultiplexImageNodeDelegate;
|
@protocol ASMultiplexImageNodeDelegate;
|
||||||
@protocol ASMultiplexImageNodeDataSource;
|
@protocol ASMultiplexImageNodeDataSource;
|
||||||
|
|
||||||
|
typedef __kindof NSObject<NSCopying> * ImageIdentifier;
|
||||||
|
|
||||||
extern NSString *const ASMultiplexImageNodeErrorDomain;
|
extern NSString *const ASMultiplexImageNodeErrorDomain;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -77,7 +80,7 @@ typedef NS_ENUM(NSUInteger, ASMultiplexImageNodeErrorCode) {
|
|||||||
*
|
*
|
||||||
* @see <downloadsIntermediateImages> for more information on the image loading process.
|
* @see <downloadsIntermediateImages> for more information on the image loading process.
|
||||||
*/
|
*/
|
||||||
@property (nonatomic, readwrite, copy) NSArray *imageIdentifiers;
|
@property (nonatomic, readwrite, copy) NSArray<ImageIdentifier> *imageIdentifiers;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @abstract Notify the receiver that its data source has new UIImages or NSURLs available for <imageIdentifiers>.
|
* @abstract Notify the receiver that its data source has new UIImages or NSURLs available for <imageIdentifiers>.
|
||||||
@@ -91,12 +94,12 @@ typedef NS_ENUM(NSUInteger, ASMultiplexImageNodeErrorCode) {
|
|||||||
*
|
*
|
||||||
* @discussion This value may differ from <displayedImageIdentifier> if the image hasn't yet been displayed.
|
* @discussion This value may differ from <displayedImageIdentifier> if the image hasn't yet been displayed.
|
||||||
*/
|
*/
|
||||||
@property (nonatomic, readonly) id loadedImageIdentifier;
|
@property (nullable, nonatomic, readonly) ImageIdentifier loadedImageIdentifier;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @abstract The identifier for the image that the receiver is currently displaying, or nil.
|
* @abstract The identifier for the image that the receiver is currently displaying, or nil.
|
||||||
*/
|
*/
|
||||||
@property (nonatomic, readonly) id displayedImageIdentifier;
|
@property (nullable, nonatomic, readonly) ImageIdentifier displayedImageIdentifier;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@@ -124,7 +127,7 @@ typedef NS_ENUM(NSUInteger, ASMultiplexImageNodeErrorCode) {
|
|||||||
*/
|
*/
|
||||||
- (void)multiplexImageNode:(ASMultiplexImageNode *)imageNode
|
- (void)multiplexImageNode:(ASMultiplexImageNode *)imageNode
|
||||||
didUpdateDownloadProgress:(CGFloat)downloadProgress
|
didUpdateDownloadProgress:(CGFloat)downloadProgress
|
||||||
forImageWithIdentifier:(id)imageIdentifier;
|
forImageWithIdentifier:(ImageIdentifier)imageIdentifier;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @abstract Notification that the image node's download has finished.
|
* @abstract Notification that the image node's download has finished.
|
||||||
@@ -133,8 +136,8 @@ typedef NS_ENUM(NSUInteger, ASMultiplexImageNodeErrorCode) {
|
|||||||
* @param error The error that occurred while downloading, if one occurred; nil otherwise.
|
* @param error The error that occurred while downloading, if one occurred; nil otherwise.
|
||||||
*/
|
*/
|
||||||
- (void)multiplexImageNode:(ASMultiplexImageNode *)imageNode
|
- (void)multiplexImageNode:(ASMultiplexImageNode *)imageNode
|
||||||
didFinishDownloadingImageWithIdentifier:(id)imageIdentifier
|
didFinishDownloadingImageWithIdentifier:(ImageIdentifier)imageIdentifier
|
||||||
error:(NSError *)error;
|
error:(nullable NSError *)error;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @abstract Notification that the image node's image was updated.
|
* @abstract Notification that the image node's image was updated.
|
||||||
@@ -147,10 +150,10 @@ didFinishDownloadingImageWithIdentifier:(id)imageIdentifier
|
|||||||
* @see <[ASMultiplexImageNodeDelegate multiplexImageNode:didDisplayUpdatedImage:withIdentifier:]>.
|
* @see <[ASMultiplexImageNodeDelegate multiplexImageNode:didDisplayUpdatedImage:withIdentifier:]>.
|
||||||
*/
|
*/
|
||||||
- (void)multiplexImageNode:(ASMultiplexImageNode *)imageNode
|
- (void)multiplexImageNode:(ASMultiplexImageNode *)imageNode
|
||||||
didUpdateImage:(UIImage *)image
|
didUpdateImage:(nullable UIImage *)image
|
||||||
withIdentifier:(id)imageIdentifier
|
withIdentifier:(nullable ImageIdentifier)imageIdentifier
|
||||||
fromImage:(UIImage *)previousImage
|
fromImage:(nullable UIImage *)previousImage
|
||||||
withIdentifier:(id)previousImageIdentifier;
|
withIdentifier:(nullable ImageIdentifier)previousImageIdentifier;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @abstract Notification that the image node displayed a new image.
|
* @abstract Notification that the image node displayed a new image.
|
||||||
@@ -160,8 +163,8 @@ didFinishDownloadingImageWithIdentifier:(id)imageIdentifier
|
|||||||
* @discussion This method is only called when `image` changes, and not on subsequent redisplays of the same image.
|
* @discussion This method is only called when `image` changes, and not on subsequent redisplays of the same image.
|
||||||
*/
|
*/
|
||||||
- (void)multiplexImageNode:(ASMultiplexImageNode *)imageNode
|
- (void)multiplexImageNode:(ASMultiplexImageNode *)imageNode
|
||||||
didDisplayUpdatedImage:(UIImage *)image
|
didDisplayUpdatedImage:(nullable UIImage *)image
|
||||||
withIdentifier:(id)imageIdentifier;
|
withIdentifier:(nullable ImageIdentifier)imageIdentifier;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @abstract Notification that the image node finished displaying an image.
|
* @abstract Notification that the image node finished displaying an image.
|
||||||
@@ -189,7 +192,7 @@ didFinishDownloadingImageWithIdentifier:(id)imageIdentifier
|
|||||||
* URL to the image via -multiplexImageNode:URLForImageIdentifier:.
|
* URL to the image via -multiplexImageNode:URLForImageIdentifier:.
|
||||||
* @returns A UIImage corresponding to `imageIdentifier`, or nil if none is available.
|
* @returns A UIImage corresponding to `imageIdentifier`, or nil if none is available.
|
||||||
*/
|
*/
|
||||||
- (UIImage *)multiplexImageNode:(ASMultiplexImageNode *)imageNode imageForImageIdentifier:(id)imageIdentifier;
|
- (nullable UIImage *)multiplexImageNode:(ASMultiplexImageNode *)imageNode imageForImageIdentifier:(ImageIdentifier)imageIdentifier;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @abstract An image URL for the specified identifier.
|
* @abstract An image URL for the specified identifier.
|
||||||
@@ -200,6 +203,8 @@ didFinishDownloadingImageWithIdentifier:(id)imageIdentifier
|
|||||||
* multiplexImageNode:imageForImageIdentifier:]> instead.
|
* multiplexImageNode:imageForImageIdentifier:]> instead.
|
||||||
* @returns An NSURL for the image identified by `imageIdentifier`, or nil if none is available.
|
* @returns An NSURL for the image identified by `imageIdentifier`, or nil if none is available.
|
||||||
*/
|
*/
|
||||||
- (NSURL *)multiplexImageNode:(ASMultiplexImageNode *)imageNode URLForImageIdentifier:(id)imageIdentifier;
|
- (nullable NSURL *)multiplexImageNode:(ASMultiplexImageNode *)imageNode URLForImageIdentifier:(ImageIdentifier)imageIdentifier;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
#import <AsyncDisplayKit/ASImageNode.h>
|
#import <AsyncDisplayKit/ASImageNode.h>
|
||||||
#import <AsyncDisplayKit/ASImageProtocols.h>
|
#import <AsyncDisplayKit/ASImageProtocols.h>
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
@protocol ASNetworkImageNodeDelegate;
|
@protocol ASNetworkImageNodeDelegate;
|
||||||
|
|
||||||
@@ -32,7 +33,7 @@
|
|||||||
*
|
*
|
||||||
* @returns An initialized ASNetworkImageNode.
|
* @returns An initialized ASNetworkImageNode.
|
||||||
*/
|
*/
|
||||||
- (instancetype)initWithCache:(id<ASImageCacheProtocol>)cache downloader:(id<ASImageDownloaderProtocol>)downloader;
|
- (instancetype)initWithCache:(nullable id<ASImageCacheProtocol>)cache downloader:(id<ASImageDownloaderProtocol>)downloader NS_DESIGNATED_INITIALIZER;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convenience initialiser.
|
* Convenience initialiser.
|
||||||
@@ -49,14 +50,14 @@
|
|||||||
/**
|
/**
|
||||||
* A placeholder image to display while the URL is loading.
|
* A placeholder image to display while the URL is loading.
|
||||||
*/
|
*/
|
||||||
@property (atomic, strong, readwrite) UIImage *defaultImage;
|
@property (nullable, atomic, strong, readwrite) UIImage *defaultImage;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The URL of a new image to download and display.
|
* The URL of a new image to download and display.
|
||||||
*
|
*
|
||||||
* @discussion Changing this property will reset the displayed image to a placeholder (<defaultImage>) while loading.
|
* @discussion Changing this property will reset the displayed image to a placeholder (<defaultImage>) while loading.
|
||||||
*/
|
*/
|
||||||
@property (atomic, strong, readwrite) NSURL *URL;
|
@property (nullable, atomic, strong, readwrite) NSURL *URL;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Download and display a new image.
|
* Download and display a new image.
|
||||||
@@ -65,7 +66,7 @@
|
|||||||
*
|
*
|
||||||
* @param reset Whether to display a placeholder (<defaultImage>) while loading the new image.
|
* @param reset Whether to display a placeholder (<defaultImage>) while loading the new image.
|
||||||
*/
|
*/
|
||||||
- (void)setURL:(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 cacheing. Defaults to YES.
|
||||||
@@ -102,3 +103,5 @@
|
|||||||
- (void)imageNodeDidFinishDecoding:(ASNetworkImageNode *)imageNode;
|
- (void)imageNodeDidFinishDecoding:(ASNetworkImageNode *)imageNode;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
|
|
||||||
#import <AsyncDisplayKit/ASDisplayNode.h>
|
#import <AsyncDisplayKit/ASDisplayNode.h>
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Simple node that wraps UIScrollView.
|
* Simple node that wraps UIScrollView.
|
||||||
@@ -22,3 +23,5 @@
|
|||||||
@property (nonatomic, readonly, strong) UIScrollView *view;
|
@property (nonatomic, readonly, strong) UIScrollView *view;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
@@ -18,6 +18,7 @@
|
|||||||
@protocol ASTableViewDataSource;
|
@protocol ASTableViewDataSource;
|
||||||
@protocol ASTableViewDelegate;
|
@protocol ASTableViewDelegate;
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Node-based table view.
|
* Node-based table view.
|
||||||
@@ -84,7 +85,7 @@
|
|||||||
* the main thread.
|
* the main thread.
|
||||||
* @warning This method is substantially more expensive than UITableView's version.
|
* @warning This method is substantially more expensive than UITableView's version.
|
||||||
*/
|
*/
|
||||||
-(void)reloadDataWithCompletion:(void (^)())completion;
|
-(void)reloadDataWithCompletion:(void (^ _Nullable)())completion;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reload everything from scratch, destroying the working range and all cached nodes.
|
* Reload everything from scratch, destroying the working range and all cached nodes.
|
||||||
@@ -120,7 +121,7 @@
|
|||||||
* Boolean parameter that contains the value YES if all of the related animations completed successfully or
|
* Boolean parameter that contains the value YES if all of the related animations completed successfully or
|
||||||
* NO if they were interrupted. This parameter may be nil. If supplied, the block is run on the main thread.
|
* NO if they were interrupted. This parameter may be nil. If supplied, the block is run on the main thread.
|
||||||
*/
|
*/
|
||||||
- (void)endUpdatesAnimated:(BOOL)animated completion:(void (^)(BOOL completed))completion;
|
- (void)endUpdatesAnimated:(BOOL)animated completion:(void (^ _Nullable)(BOOL completed))completion;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Inserts one or more sections, with an option to animate the insertion.
|
* Inserts one or more sections, with an option to animate the insertion.
|
||||||
@@ -180,7 +181,7 @@
|
|||||||
* @discussion This method must be called from the main thread. The asyncDataSource must be updated to reflect the changes
|
* @discussion This method must be called from the main thread. The asyncDataSource must be updated to reflect the changes
|
||||||
* before this method is called.
|
* before this method is called.
|
||||||
*/
|
*/
|
||||||
- (void)insertRowsAtIndexPaths:(NSArray *)indexPaths withRowAnimation:(UITableViewRowAnimation)animation;
|
- (void)insertRowsAtIndexPaths:(NSArray<NSIndexPath *> *)indexPaths withRowAnimation:(UITableViewRowAnimation)animation;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deletes the rows specified by an array of index paths, with an option to animate the deletion.
|
* Deletes the rows specified by an array of index paths, with an option to animate the deletion.
|
||||||
@@ -192,7 +193,7 @@
|
|||||||
* @discussion This method must be called from the main thread. The asyncDataSource must be updated to reflect the changes
|
* @discussion This method must be called from the main thread. The asyncDataSource must be updated to reflect the changes
|
||||||
* before this method is called.
|
* before this method is called.
|
||||||
*/
|
*/
|
||||||
- (void)deleteRowsAtIndexPaths:(NSArray *)indexPaths withRowAnimation:(UITableViewRowAnimation)animation;
|
- (void)deleteRowsAtIndexPaths:(NSArray<NSIndexPath *> *)indexPaths withRowAnimation:(UITableViewRowAnimation)animation;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reloads the specified rows using a given animation effect.
|
* Reloads the specified rows using a given animation effect.
|
||||||
@@ -204,7 +205,7 @@
|
|||||||
* @discussion This method must be called from the main thread. The asyncDataSource must be updated to reflect the changes
|
* @discussion This method must be called from the main thread. The asyncDataSource must be updated to reflect the changes
|
||||||
* before this method is called.
|
* before this method is called.
|
||||||
*/
|
*/
|
||||||
- (void)reloadRowsAtIndexPaths:(NSArray *)indexPaths withRowAnimation:(UITableViewRowAnimation)animation;
|
- (void)reloadRowsAtIndexPaths:(NSArray<NSIndexPath *> *)indexPaths withRowAnimation:(UITableViewRowAnimation)animation;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Moves the row at a specified location to a destination location.
|
* Moves the row at a specified location to a destination location.
|
||||||
@@ -232,7 +233,7 @@
|
|||||||
*
|
*
|
||||||
* @returns an array containing the nodes being displayed on screen.
|
* @returns an array containing the nodes being displayed on screen.
|
||||||
*/
|
*/
|
||||||
- (NSArray *)visibleNodes;
|
- (NSArray<ASDisplayNode *> *)visibleNodes;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* YES to automatically adjust the contentOffset when cells are inserted or deleted "before"
|
* YES to automatically adjust the contentOffset when cells are inserted or deleted "before"
|
||||||
@@ -298,7 +299,7 @@
|
|||||||
@optional
|
@optional
|
||||||
|
|
||||||
- (void)tableView:(ASTableView *)tableView willDisplayNodeForRowAtIndexPath:(NSIndexPath *)indexPath;
|
- (void)tableView:(ASTableView *)tableView willDisplayNodeForRowAtIndexPath:(NSIndexPath *)indexPath;
|
||||||
- (void)tableView:(ASTableView *)tableView didEndDisplayingNodeForRowAtIndexPath:(NSIndexPath*)indexPath;
|
- (void)tableView:(ASTableView *)tableView didEndDisplayingNodeForRowAtIndexPath:(NSIndexPath *)indexPath;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Receive a message that the tableView is near the end of its data set and more data should be fetched if necessary.
|
* Receive a message that the tableView is near the end of its data set and more data should be fetched if necessary.
|
||||||
@@ -334,3 +335,5 @@
|
|||||||
@property (nonatomic, assign) ASRangeTuningParameters rangeTuningParameters ASDISPLAYNODE_DEPRECATED;
|
@property (nonatomic, assign) ASRangeTuningParameters rangeTuningParameters ASDISPLAYNODE_DEPRECATED;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
|
|||||||
@@ -6,6 +6,8 @@
|
|||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
* of patent rights can be found in the PATENTS file in the same directory.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is a subset of UITableViewDataSource.
|
* This is a subset of UITableViewDataSource.
|
||||||
*
|
*
|
||||||
@@ -21,14 +23,14 @@
|
|||||||
|
|
||||||
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView;
|
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView;
|
||||||
|
|
||||||
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section;
|
- (nullable NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section;
|
||||||
- (NSString *)tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section;
|
- (nullable NSString *)tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section;
|
||||||
|
|
||||||
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath;
|
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath;
|
||||||
|
|
||||||
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath;
|
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath;
|
||||||
|
|
||||||
- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView;
|
- (nullable NSArray<NSString *> *)sectionIndexTitlesForTableView:(UITableView *)tableView;
|
||||||
- (NSInteger)tableView:(UITableView *)tableView sectionForSectionIndexTitle:(NSString *)title atIndex:(NSInteger)index;
|
- (NSInteger)tableView:(UITableView *)tableView sectionForSectionIndexTitle:(NSString *)title atIndex:(NSInteger)index;
|
||||||
|
|
||||||
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath;
|
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath;
|
||||||
@@ -55,8 +57,8 @@
|
|||||||
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section;
|
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section;
|
||||||
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section;
|
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section;
|
||||||
|
|
||||||
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section;
|
- (nullable UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section;
|
||||||
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section;
|
- (nullable UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section;
|
||||||
|
|
||||||
- (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath;
|
- (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath;
|
||||||
|
|
||||||
@@ -64,14 +66,14 @@
|
|||||||
- (void)tableView:(UITableView *)tableView didHighlightRowAtIndexPath:(NSIndexPath *)indexPath;
|
- (void)tableView:(UITableView *)tableView didHighlightRowAtIndexPath:(NSIndexPath *)indexPath;
|
||||||
- (void)tableView:(UITableView *)tableView didUnhighlightRowAtIndexPath:(NSIndexPath *)indexPath;
|
- (void)tableView:(UITableView *)tableView didUnhighlightRowAtIndexPath:(NSIndexPath *)indexPath;
|
||||||
|
|
||||||
- (NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath;
|
- (nullable NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath;
|
||||||
- (NSIndexPath *)tableView:(UITableView *)tableView willDeselectRowAtIndexPath:(NSIndexPath *)indexPath;
|
- (nullable NSIndexPath *)tableView:(UITableView *)tableView willDeselectRowAtIndexPath:(NSIndexPath *)indexPath;
|
||||||
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath;
|
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath;
|
||||||
- (void)tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPath;
|
- (void)tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPath;
|
||||||
|
|
||||||
- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath;
|
- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath;
|
||||||
- (NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath;
|
- (nullable NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath;
|
||||||
- (NSArray *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath;
|
- (nullable NSArray<UITableViewRowAction *> *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath;
|
||||||
|
|
||||||
- (BOOL)tableView:(UITableView *)tableView shouldIndentWhileEditingRowAtIndexPath:(NSIndexPath *)indexPath;
|
- (BOOL)tableView:(UITableView *)tableView shouldIndentWhileEditingRowAtIndexPath:(NSIndexPath *)indexPath;
|
||||||
|
|
||||||
@@ -83,7 +85,9 @@
|
|||||||
- (NSInteger)tableView:(UITableView *)tableView indentationLevelForRowAtIndexPath:(NSIndexPath *)indexPath;
|
- (NSInteger)tableView:(UITableView *)tableView indentationLevelForRowAtIndexPath:(NSIndexPath *)indexPath;
|
||||||
|
|
||||||
- (BOOL)tableView:(UITableView *)tableView shouldShowMenuForRowAtIndexPath:(NSIndexPath *)indexPath;
|
- (BOOL)tableView:(UITableView *)tableView shouldShowMenuForRowAtIndexPath:(NSIndexPath *)indexPath;
|
||||||
- (BOOL)tableView:(UITableView *)tableView canPerformAction:(SEL)action forRowAtIndexPath:(NSIndexPath *)indexPath withSender:(id)sender;
|
- (BOOL)tableView:(UITableView *)tableView canPerformAction:(SEL)action forRowAtIndexPath:(NSIndexPath *)indexPath withSender:(nullable id)sender;
|
||||||
- (void)tableView:(UITableView *)tableView performAction:(SEL)action forRowAtIndexPath:(NSIndexPath *)indexPath withSender:(id)sender;
|
- (void)tableView:(UITableView *)tableView performAction:(SEL)action forRowAtIndexPath:(NSIndexPath *)indexPath withSender:(nullable id)sender;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
|
|||||||
@@ -8,6 +8,8 @@
|
|||||||
|
|
||||||
#import <AsyncDisplayKit/ASControlNode.h>
|
#import <AsyncDisplayKit/ASControlNode.h>
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
@protocol ASTextNodeDelegate;
|
@protocol ASTextNodeDelegate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -36,7 +38,7 @@ typedef NS_ENUM(NSUInteger, ASTextNodeHighlightStyle) {
|
|||||||
@discussion Defaults to nil, no text is shown.
|
@discussion Defaults to nil, no text is shown.
|
||||||
For inline image attachments, add an attribute of key NSAttachmentAttributeName, with a value of an NSTextAttachment.
|
For inline image attachments, add an attribute of key NSAttachmentAttributeName, with a value of an NSTextAttachment.
|
||||||
*/
|
*/
|
||||||
@property (nonatomic, copy) NSAttributedString *attributedString;
|
@property (nullable, nonatomic, copy) NSAttributedString *attributedString;
|
||||||
|
|
||||||
#pragma mark - Truncation
|
#pragma mark - Truncation
|
||||||
|
|
||||||
@@ -75,14 +77,14 @@ typedef NS_ENUM(NSUInteger, ASTextNodeHighlightStyle) {
|
|||||||
*/
|
*/
|
||||||
@property (nonatomic, readonly, assign) NSUInteger lineCount;
|
@property (nonatomic, readonly, assign) NSUInteger lineCount;
|
||||||
|
|
||||||
@property (nonatomic, strong) NSArray *exclusionPaths;
|
@property (nonatomic, strong) NSArray<UIBezierPath *> *exclusionPaths;
|
||||||
|
|
||||||
#pragma mark - Placeholders
|
#pragma mark - Placeholders
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@abstract The placeholder color.
|
@abstract The placeholder color.
|
||||||
*/
|
*/
|
||||||
@property (nonatomic, strong) UIColor *placeholderColor;
|
@property (nullable, nonatomic, strong) UIColor *placeholderColor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@abstract Inset each line of the placeholder.
|
@abstract Inset each line of the placeholder.
|
||||||
@@ -118,7 +120,7 @@ typedef NS_ENUM(NSUInteger, ASTextNodeHighlightStyle) {
|
|||||||
a line break, the rects returned will be on opposite sides and different lines). The rects returned
|
a line break, the rects returned will be on opposite sides and different lines). The rects returned
|
||||||
are in the coordinate system of the receiver.
|
are in the coordinate system of the receiver.
|
||||||
*/
|
*/
|
||||||
- (NSArray *)rectsForTextRange:(NSRange)textRange;
|
- (NSArray<NSValue *> *)rectsForTextRange:(NSRange)textRange;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@abstract Returns an array of rects used for highlighting the characters in a given text range.
|
@abstract Returns an array of rects used for highlighting the characters in a given text range.
|
||||||
@@ -129,7 +131,7 @@ typedef NS_ENUM(NSUInteger, ASTextNodeHighlightStyle) {
|
|||||||
are in the coordinate system of the receiver. This method is useful for visual coordination with a
|
are in the coordinate system of the receiver. This method is useful for visual coordination with a
|
||||||
highlighted range of text.
|
highlighted range of text.
|
||||||
*/
|
*/
|
||||||
- (NSArray *)highlightRectsForTextRange:(NSRange)textRange;
|
- (NSArray<NSValue *> *)highlightRectsForTextRange:(NSRange)textRange;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@abstract Returns a bounding rect for the given text range.
|
@abstract Returns a bounding rect for the given text range.
|
||||||
@@ -153,7 +155,7 @@ typedef NS_ENUM(NSUInteger, ASTextNodeHighlightStyle) {
|
|||||||
/**
|
/**
|
||||||
@abstract The set of attribute names to consider links. Defaults to NSLinkAttributeName.
|
@abstract The set of attribute names to consider links. Defaults to NSLinkAttributeName.
|
||||||
*/
|
*/
|
||||||
@property (nonatomic, copy) NSArray *linkAttributeNames;
|
@property (nonatomic, copy) NSArray<NSString *> *linkAttributeNames;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@abstract Indicates whether the receiver has an entity at a given point.
|
@abstract Indicates whether the receiver has an entity at a given point.
|
||||||
@@ -162,7 +164,7 @@ typedef NS_ENUM(NSUInteger, ASTextNodeHighlightStyle) {
|
|||||||
@param rangeOut The ultimate range of the found text. Can be NULL.
|
@param rangeOut The ultimate range of the found text. Can be NULL.
|
||||||
@result YES if an entity exists at `point`; NO otherwise.
|
@result YES if an entity exists at `point`; NO otherwise.
|
||||||
*/
|
*/
|
||||||
- (id)linkAttributeValueAtPoint:(CGPoint)point attributeName:(out NSString **)attributeNameOut range:(out NSRange *)rangeOut;
|
- (nullable id)linkAttributeValueAtPoint:(CGPoint)point attributeName:(out NSString * _Nullable * _Nullable)attributeNameOut range:(out NSRange * _Nullable)rangeOut;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@abstract The style to use when highlighting text.
|
@abstract The style to use when highlighting text.
|
||||||
@@ -253,3 +255,5 @@ typedef NS_ENUM(NSUInteger, ASTextNodeHighlightStyle) {
|
|||||||
- (BOOL)textNode:(ASTextNode *)textNode shouldLongPressLinkAttribute:(NSString *)attribute value:(id)value atPoint:(CGPoint)point;
|
- (BOOL)textNode:(ASTextNode *)textNode shouldLongPressLinkAttribute:(NSString *)attribute value:(id)value atPoint:(CGPoint)point;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
|
|||||||
@@ -128,6 +128,8 @@
|
|||||||
050E7C6619D22E19004363C2 /* Project object */ = {
|
050E7C6619D22E19004363C2 /* Project object */ = {
|
||||||
isa = PBXProject;
|
isa = PBXProject;
|
||||||
attributes = {
|
attributes = {
|
||||||
|
LastSwiftMigration = 0700;
|
||||||
|
LastSwiftUpdateCheck = 0700;
|
||||||
LastUpgradeCheck = 0600;
|
LastUpgradeCheck = 0600;
|
||||||
ORGANIZATIONNAME = Facebook;
|
ORGANIZATIONNAME = Facebook;
|
||||||
TargetAttributes = {
|
TargetAttributes = {
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ class ViewController: UIViewController, ASTableViewDataSource, ASTableViewDelega
|
|||||||
self.tableView.asyncDelegate = self
|
self.tableView.asyncDelegate = self
|
||||||
}
|
}
|
||||||
|
|
||||||
required init(coder aDecoder: NSCoder) {
|
required init?(coder aDecoder: NSCoder) {
|
||||||
fatalError("storyboards are incompatible with truth and beauty")
|
fatalError("storyboards are incompatible with truth and beauty")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user