mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-15 18:59:54 +00:00
Standardize Property Declaration Style in Core Classes (#870)
* Audit property attributes for core classes * Update style guide * Go crazy * Update changelog
This commit is contained in:
parent
9ccba7fe74
commit
cac14e0bce
@ -55,6 +55,7 @@
|
||||
- Fix an issue where ASConfigurationDelegate would not call out for "control" users. If set, it now receives events whenever an experimental feature decision point occurs, whether it's enabled or not. [Adlai Holler](https://github.com/Adlai-Holler)
|
||||
- [ASDisplayNode] Fix an issue that causes a node to sometimes return an outdated calculated size or size range. [Huy Nguyen](https://github.com/nguyenhuy) [#808](https://github.com/TextureGroup/Texture/pull/808)
|
||||
- Add an experimental deallocation queue implementation that's more efficient. [Adlai Holler](https://github.com/Adlai-Holler)
|
||||
- Standardize property declaration style. [Adlai Holler](https://github.com/Adlai-Holler)
|
||||
|
||||
## 2.6
|
||||
- [Xcode 9] Updated to require Xcode 9 (to fix warnings) [Garrett Moon](https://github.com/garrettmoon)
|
||||
|
||||
@ -238,7 +238,10 @@ static void someFunction() {
|
||||
- There is mostly no sense using nullability annotations outside of interface declarations.
|
||||
```objc
|
||||
// Properties
|
||||
@property(nonatomic, strong, nullable) NSNumber *status
|
||||
// Never include: `atomic`, `readwrite`, `strong`, `assign`.
|
||||
// Only specify nullability if it isn't assumed from NS_ASSUME.
|
||||
// (nullability, atomicity, storage class, writability, custom getter, custom setter)
|
||||
@property (nullable, copy) NSNumber *status
|
||||
|
||||
// Methods
|
||||
- (nullable NSNumber *)doSomethingWithString:(nullable NSString *)str;
|
||||
|
||||
@ -34,41 +34,41 @@ typedef NS_ENUM(NSInteger, ASButtonNodeImageAlignment) {
|
||||
|
||||
@interface ASButtonNode : ASControlNode
|
||||
|
||||
@property (nonatomic, readonly) ASTextNode * titleNode;
|
||||
@property (nonatomic, readonly) ASImageNode * imageNode;
|
||||
@property (nonatomic, readonly) ASImageNode * backgroundImageNode;
|
||||
@property (readonly) ASTextNode * titleNode;
|
||||
@property (readonly) ASImageNode * imageNode;
|
||||
@property (readonly) ASImageNode * backgroundImageNode;
|
||||
|
||||
/**
|
||||
Spacing between image and title. Defaults to 8.0.
|
||||
*/
|
||||
@property (nonatomic, assign) CGFloat contentSpacing;
|
||||
@property CGFloat contentSpacing;
|
||||
|
||||
/**
|
||||
Whether button should be laid out vertically (image on top of text) or horizontally (image to the left of text).
|
||||
ASButton node does not yet support RTL but it should be fairly easy to implement.
|
||||
Defaults to YES.
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL laysOutHorizontally;
|
||||
@property BOOL laysOutHorizontally;
|
||||
|
||||
/** Horizontally align content (text or image).
|
||||
Defaults to ASHorizontalAlignmentMiddle.
|
||||
*/
|
||||
@property (nonatomic, assign) ASHorizontalAlignment contentHorizontalAlignment;
|
||||
@property ASHorizontalAlignment contentHorizontalAlignment;
|
||||
|
||||
/** Vertically align content (text or image).
|
||||
Defaults to ASVerticalAlignmentCenter.
|
||||
*/
|
||||
@property (nonatomic, assign) ASVerticalAlignment contentVerticalAlignment;
|
||||
@property ASVerticalAlignment contentVerticalAlignment;
|
||||
|
||||
/**
|
||||
* @discussion The insets used around the title and image node
|
||||
*/
|
||||
@property (nonatomic, assign) UIEdgeInsets contentEdgeInsets;
|
||||
@property UIEdgeInsets contentEdgeInsets;
|
||||
|
||||
/**
|
||||
* @discusstion Whether the image should be aligned at the beginning or at the end of node. Default is `ASButtonNodeImageAlignmentBeginning`.
|
||||
*/
|
||||
@property (nonatomic, assign) ASButtonNodeImageAlignment imageAlignment;
|
||||
@property ASButtonNodeImageAlignment imageAlignment;
|
||||
|
||||
/**
|
||||
* Returns the styled title associated with the specified state.
|
||||
|
||||
@ -78,6 +78,7 @@
|
||||
|
||||
- (ASTextNode *)titleNode
|
||||
{
|
||||
ASLockScopeSelf();
|
||||
if (!_titleNode) {
|
||||
_titleNode = [[ASTextNode alloc] init];
|
||||
#if TARGET_OS_IOS
|
||||
@ -92,6 +93,7 @@
|
||||
|
||||
- (ASImageNode *)imageNode
|
||||
{
|
||||
ASLockScopeSelf();
|
||||
if (!_imageNode) {
|
||||
_imageNode = [[ASImageNode alloc] init];
|
||||
[_imageNode setLayerBacked:YES];
|
||||
@ -101,6 +103,7 @@
|
||||
|
||||
- (ASImageNode *)backgroundImageNode
|
||||
{
|
||||
ASLockScopeSelf();
|
||||
if (!_backgroundImageNode) {
|
||||
_backgroundImageNode = [[ASImageNode alloc] init];
|
||||
[_backgroundImageNode setLayerBacked:YES];
|
||||
@ -162,7 +165,7 @@
|
||||
- (void)updateImage
|
||||
{
|
||||
[self lock];
|
||||
|
||||
|
||||
UIImage *newImage;
|
||||
if (self.enabled == NO && _disabledImage) {
|
||||
newImage = _disabledImage;
|
||||
@ -253,16 +256,9 @@
|
||||
|
||||
- (void)setContentSpacing:(CGFloat)contentSpacing
|
||||
{
|
||||
{
|
||||
ASLockScopeSelf();
|
||||
if (contentSpacing == _contentSpacing) {
|
||||
return;
|
||||
}
|
||||
|
||||
_contentSpacing = contentSpacing;
|
||||
if (ASLockedSelfCompareAssign(_contentSpacing, contentSpacing)) {
|
||||
[self setNeedsLayout];
|
||||
}
|
||||
|
||||
[self setNeedsLayout];
|
||||
}
|
||||
|
||||
- (BOOL)laysOutHorizontally
|
||||
@ -273,16 +269,9 @@
|
||||
|
||||
- (void)setLaysOutHorizontally:(BOOL)laysOutHorizontally
|
||||
{
|
||||
{
|
||||
ASLockScopeSelf();
|
||||
if (laysOutHorizontally == _laysOutHorizontally) {
|
||||
return;
|
||||
}
|
||||
|
||||
_laysOutHorizontally = laysOutHorizontally;
|
||||
if (ASLockedSelfCompareAssign(_laysOutHorizontally, laysOutHorizontally)) {
|
||||
[self setNeedsLayout];
|
||||
}
|
||||
|
||||
[self setNeedsLayout];
|
||||
}
|
||||
|
||||
- (ASVerticalAlignment)contentVerticalAlignment
|
||||
|
||||
@ -80,14 +80,14 @@ typedef NS_ENUM(NSUInteger, ASCellNodeVisibilityEvent) {
|
||||
* blocking time is very short. If the rangeTuningParameters are set to 0, still this option
|
||||
* outperforms UIKit: while the main thread is waiting, subnode display executes concurrently.
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL neverShowPlaceholders;
|
||||
@property BOOL neverShowPlaceholders;
|
||||
|
||||
/*
|
||||
* The kind of supplementary element this node represents, if any.
|
||||
*
|
||||
* @return The supplementary element kind, or @c nil if this node does not represent a supplementary element.
|
||||
*/
|
||||
@property (atomic, copy, readonly, nullable) NSString *supplementaryElementKind;
|
||||
@property (nullable, copy, readonly) NSString *supplementaryElementKind;
|
||||
|
||||
/*
|
||||
* The layout attributes currently assigned to this node, if any.
|
||||
@ -96,25 +96,25 @@ typedef NS_ENUM(NSUInteger, ASCellNodeVisibilityEvent) {
|
||||
* is called, when the node is not yet in the hierarchy and its frame cannot be converted to/from other nodes. Instead
|
||||
* you can use the layout attributes object to learn where and how the cell will be displayed.
|
||||
*/
|
||||
@property (nonatomic, strong, readonly, nullable) UICollectionViewLayoutAttributes *layoutAttributes;
|
||||
@property (nullable, copy, readonly) UICollectionViewLayoutAttributes *layoutAttributes;
|
||||
|
||||
/**
|
||||
* A Boolean value that is synchronized with the underlying collection or tableView cell property.
|
||||
* Setting this value is equivalent to calling selectItem / deselectItem on the collection or table.
|
||||
*/
|
||||
@property (nonatomic, assign, getter=isSelected) BOOL selected;
|
||||
@property (getter=isSelected) BOOL selected;
|
||||
|
||||
/**
|
||||
* A Boolean value that is synchronized with the underlying collection or tableView cell property.
|
||||
* Setting this value is equivalent to calling highlightItem / unHighlightItem on the collection or table.
|
||||
*/
|
||||
@property (nonatomic, assign, getter=isHighlighted) BOOL highlighted;
|
||||
@property (getter=isHighlighted) BOOL highlighted;
|
||||
|
||||
/**
|
||||
* The current index path of this cell node, or @c nil if this node is
|
||||
* not a valid item inside a table node or collection node.
|
||||
*/
|
||||
@property (atomic, readonly, nullable) NSIndexPath *indexPath;
|
||||
@property (nullable, copy, readonly) NSIndexPath *indexPath;
|
||||
|
||||
/**
|
||||
* BETA: API is under development. We will attempt to provide an easy migration pathway for any changes.
|
||||
@ -123,7 +123,7 @@ typedef NS_ENUM(NSUInteger, ASCellNodeVisibilityEvent) {
|
||||
*
|
||||
* This property may be set off the main thread, but this method will never be invoked concurrently on the
|
||||
*/
|
||||
@property (atomic, nullable) id nodeModel;
|
||||
@property (nullable) id nodeModel;
|
||||
|
||||
/**
|
||||
* Asks the node whether it can be updated to the given node model.
|
||||
@ -136,13 +136,13 @@ typedef NS_ENUM(NSUInteger, ASCellNodeVisibilityEvent) {
|
||||
* The backing view controller, or @c nil if the node wasn't initialized with backing view controller
|
||||
* @note This property must be accessed on the main thread.
|
||||
*/
|
||||
@property (nonatomic, readonly, nullable) UIViewController *viewController;
|
||||
@property (nullable, nonatomic, readonly) UIViewController *viewController;
|
||||
|
||||
|
||||
/**
|
||||
* The table- or collection-node that this cell is a member of, if any.
|
||||
*/
|
||||
@property (atomic, weak, readonly, nullable) id<ASRangeManagingNode> owningNode;
|
||||
@property (nullable, weak, readonly) id<ASRangeManagingNode> owningNode;
|
||||
|
||||
/*
|
||||
* ASCellNode must forward touch events in order for UITableView and UICollectionView tap handling to work. Overriding
|
||||
@ -188,38 +188,38 @@ typedef NS_ENUM(NSUInteger, ASCellNodeVisibilityEvent) {
|
||||
* @default UITableViewCellSelectionStyleDefault
|
||||
* ASTableView uses these properties when configuring UITableViewCells that host ASCellNodes.
|
||||
*/
|
||||
@property (nonatomic) UITableViewCellSelectionStyle selectionStyle;
|
||||
@property UITableViewCellSelectionStyle selectionStyle;
|
||||
|
||||
/* @abstract The focus style when a cell is focused
|
||||
* @default UITableViewCellFocusStyleDefault
|
||||
* ASTableView uses these properties when configuring UITableViewCells that host ASCellNodes.
|
||||
*/
|
||||
@property (nonatomic) UITableViewCellFocusStyle focusStyle;
|
||||
@property UITableViewCellFocusStyle focusStyle;
|
||||
|
||||
/* @abstract The view used as the background of the cell when it is selected.
|
||||
* ASTableView uses these properties when configuring UITableViewCells that host ASCellNodes.
|
||||
* ASCollectionView uses these properties when configuring UICollectionViewCells that host ASCellNodes.
|
||||
*/
|
||||
@property (nonatomic, strong, nullable) UIView *selectedBackgroundView;
|
||||
@property (nullable) UIView *selectedBackgroundView;
|
||||
|
||||
/* @abstract The accessory type view on the right side of the cell. Please take care of your ASLayoutSpec so that doesn't overlay the accessoryView
|
||||
* @default UITableViewCellAccessoryNone
|
||||
* ASTableView uses these properties when configuring UITableViewCells that host ASCellNodes.
|
||||
*/
|
||||
@property (nonatomic) UITableViewCellAccessoryType accessoryType;
|
||||
@property UITableViewCellAccessoryType accessoryType;
|
||||
|
||||
/* @abstract The inset of the cell separator line
|
||||
* ASTableView uses these properties when configuring UITableViewCells that host ASCellNodes.
|
||||
*/
|
||||
@property (nonatomic) UIEdgeInsets separatorInset;
|
||||
@property UIEdgeInsets separatorInset;
|
||||
|
||||
@end
|
||||
|
||||
@interface ASCellNode (Unavailable)
|
||||
|
||||
- (instancetype)initWithLayerBlock:(ASDisplayNodeLayerBlock)viewBlock didLoadBlock:(nullable ASDisplayNodeDidLoadBlock)didLoadBlock __unavailable;
|
||||
- (instancetype)initWithLayerBlock:(ASDisplayNodeLayerBlock)viewBlock didLoadBlock:(nullable ASDisplayNodeDidLoadBlock)didLoadBlock NS_UNAVAILABLE;
|
||||
|
||||
- (instancetype)initWithViewBlock:(ASDisplayNodeViewBlock)viewBlock didLoadBlock:(nullable ASDisplayNodeDidLoadBlock)didLoadBlock __unavailable;
|
||||
- (instancetype)initWithViewBlock:(ASDisplayNodeViewBlock)viewBlock didLoadBlock:(nullable ASDisplayNodeDidLoadBlock)didLoadBlock NS_UNAVAILABLE;
|
||||
|
||||
- (void)setLayerBacked:(BOOL)layerBacked AS_UNAVAILABLE("ASCellNode does not support layer-backing, although subnodes may be layer-backed.");
|
||||
|
||||
@ -239,22 +239,22 @@ typedef NS_ENUM(NSUInteger, ASCellNodeVisibilityEvent) {
|
||||
/**
|
||||
* Text to display.
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *text;
|
||||
@property (nullable, copy) NSString *text;
|
||||
|
||||
/**
|
||||
* A dictionary containing key-value pairs for text attributes. You can specify the font, text color, text shadow color, and text shadow offset using the keys listed in NSString UIKit Additions Reference.
|
||||
*/
|
||||
@property (nonatomic, copy) NSDictionary *textAttributes;
|
||||
@property (copy) NSDictionary<NSAttributedStringKey, id> *textAttributes;
|
||||
|
||||
/**
|
||||
* The text inset or outset for each edge. The default value is 15.0 horizontal and 11.0 vertical padding.
|
||||
*/
|
||||
@property (nonatomic, assign) UIEdgeInsets textInsets;
|
||||
@property UIEdgeInsets textInsets;
|
||||
|
||||
/**
|
||||
* The text node used by this cell node.
|
||||
*/
|
||||
@property (nonatomic, strong, readonly) ASTextNode *textNode;
|
||||
@property (readonly) ASTextNode *textNode;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@ -44,6 +44,9 @@
|
||||
ASDisplayNode *_viewControllerNode;
|
||||
UIViewController *_viewController;
|
||||
BOOL _suspendInteractionDelegate;
|
||||
BOOL _selected;
|
||||
BOOL _highlighted;
|
||||
UICollectionViewLayoutAttributes *_layoutAttributes;
|
||||
}
|
||||
|
||||
@end
|
||||
@ -133,29 +136,42 @@
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL)isSelected
|
||||
{
|
||||
return ASLockedSelf(_selected);
|
||||
}
|
||||
|
||||
- (void)setSelected:(BOOL)selected
|
||||
{
|
||||
if (_selected != selected) {
|
||||
_selected = selected;
|
||||
if (ASLockedSelfCompareAssign(_selected, selected)) {
|
||||
if (!_suspendInteractionDelegate) {
|
||||
[_interactionDelegate nodeSelectedStateDidChange:self];
|
||||
ASPerformBlockOnMainThread(^{
|
||||
[_interactionDelegate nodeSelectedStateDidChange:self];
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL)isHighlighted
|
||||
{
|
||||
return ASLockedSelf(_highlighted);
|
||||
}
|
||||
|
||||
- (void)setHighlighted:(BOOL)highlighted
|
||||
{
|
||||
if (_highlighted != highlighted) {
|
||||
_highlighted = highlighted;
|
||||
if (ASLockedSelfCompareAssign(_highlighted, highlighted)) {
|
||||
if (!_suspendInteractionDelegate) {
|
||||
[_interactionDelegate nodeHighlightedStateDidChange:self];
|
||||
ASPerformBlockOnMainThread(^{
|
||||
[_interactionDelegate nodeHighlightedStateDidChange:self];
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)__setSelectedFromUIKit:(BOOL)selected;
|
||||
{
|
||||
if (selected != _selected) {
|
||||
// Note: Race condition could mean redundant sets. Risk is low.
|
||||
if (ASLockedSelf(_selected != selected)) {
|
||||
_suspendInteractionDelegate = YES;
|
||||
self.selected = selected;
|
||||
_suspendInteractionDelegate = NO;
|
||||
@ -164,7 +180,8 @@
|
||||
|
||||
- (void)__setHighlightedFromUIKit:(BOOL)highlighted;
|
||||
{
|
||||
if (highlighted != _highlighted) {
|
||||
// Note: Race condition could mean redundant sets. Risk is low.
|
||||
if (ASLockedSelf(_highlighted != highlighted)) {
|
||||
_suspendInteractionDelegate = YES;
|
||||
self.highlighted = highlighted;
|
||||
_suspendInteractionDelegate = NO;
|
||||
@ -225,11 +242,15 @@
|
||||
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
- (UICollectionViewLayoutAttributes *)layoutAttributes
|
||||
{
|
||||
return ASLockedSelf(_layoutAttributes);
|
||||
}
|
||||
|
||||
- (void)setLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
|
||||
{
|
||||
ASDisplayNodeAssertMainThread();
|
||||
if (ASObjectIsEqual(layoutAttributes, _layoutAttributes) == NO) {
|
||||
_layoutAttributes = layoutAttributes;
|
||||
if (ASLockedSelfCompareAssignObjects(_layoutAttributes, layoutAttributes)) {
|
||||
if (layoutAttributes != nil) {
|
||||
[self applyLayoutAttributes:layoutAttributes];
|
||||
}
|
||||
@ -377,7 +398,11 @@
|
||||
#pragma mark -
|
||||
#pragma mark ASTextCellNode
|
||||
|
||||
@implementation ASTextCellNode
|
||||
@implementation ASTextCellNode {
|
||||
NSDictionary<NSAttributedStringKey, id> *_textAttributes;
|
||||
UIEdgeInsets _textInsets;
|
||||
NSString *_text;
|
||||
}
|
||||
|
||||
static const CGFloat kASTextCellNodeDefaultFontSize = 18.0f;
|
||||
static const CGFloat kASTextCellNodeDefaultHorizontalPadding = 15.0f;
|
||||
@ -415,39 +440,53 @@ static const CGFloat kASTextCellNodeDefaultVerticalPadding = 11.0f;
|
||||
return UIEdgeInsetsMake(kASTextCellNodeDefaultVerticalPadding, kASTextCellNodeDefaultHorizontalPadding, kASTextCellNodeDefaultVerticalPadding, kASTextCellNodeDefaultHorizontalPadding);
|
||||
}
|
||||
|
||||
- (NSDictionary *)textAttributes
|
||||
{
|
||||
return ASLockedSelf(_textAttributes);
|
||||
}
|
||||
|
||||
- (void)setTextAttributes:(NSDictionary *)textAttributes
|
||||
{
|
||||
ASDisplayNodeAssertNotNil(textAttributes, @"Invalid text attributes");
|
||||
|
||||
_textAttributes = [textAttributes copy];
|
||||
|
||||
[self updateAttributedText];
|
||||
ASLockScopeSelf();
|
||||
if (ASCompareAssignCopy(_textAttributes, textAttributes)) {
|
||||
[self locked_updateAttributedText];
|
||||
}
|
||||
}
|
||||
|
||||
- (UIEdgeInsets)textInsets
|
||||
{
|
||||
return ASLockedSelf(_textInsets);
|
||||
}
|
||||
|
||||
- (void)setTextInsets:(UIEdgeInsets)textInsets
|
||||
{
|
||||
_textInsets = textInsets;
|
||||
if (ASLockedSelfCompareAssignCustom(_textInsets, textInsets, UIEdgeInsetsEqualToEdgeInsets)) {
|
||||
[self setNeedsLayout];
|
||||
}
|
||||
}
|
||||
|
||||
[self setNeedsLayout];
|
||||
- (NSString *)text
|
||||
{
|
||||
return ASLockedSelf(_text);
|
||||
}
|
||||
|
||||
- (void)setText:(NSString *)text
|
||||
{
|
||||
if (ASObjectIsEqual(_text, text)) return;
|
||||
|
||||
_text = [text copy];
|
||||
|
||||
[self updateAttributedText];
|
||||
ASLockScopeSelf();
|
||||
if (ASCompareAssignCopy(_text, text)) {
|
||||
[self locked_updateAttributedText];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)updateAttributedText
|
||||
- (void)locked_updateAttributedText
|
||||
{
|
||||
if (_text == nil) {
|
||||
_textNode.attributedText = nil;
|
||||
return;
|
||||
}
|
||||
|
||||
_textNode.attributedText = [[NSAttributedString alloc] initWithString:self.text attributes:self.textAttributes];
|
||||
_textNode.attributedText = [[NSAttributedString alloc] initWithString:_text attributes:_textAttributes];
|
||||
[self setNeedsLayout];
|
||||
}
|
||||
|
||||
|
||||
@ -29,16 +29,16 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
*
|
||||
* @default [ASCollectionView class] is used whenever this property is unset or nil.
|
||||
*/
|
||||
@property (strong, nonatomic, nullable) Class collectionViewClass;
|
||||
@property (nullable, nonatomic) Class collectionViewClass;
|
||||
|
||||
/**
|
||||
* The elements that are currently displayed. The "UIKit index space". Must be accessed on main thread.
|
||||
*/
|
||||
@property (strong, nonatomic, readonly) ASElementMap *visibleElements;
|
||||
@property (nonatomic, readonly) ASElementMap *visibleElements;
|
||||
|
||||
@property (strong, readonly, nullable) id<ASCollectionLayoutDelegate> layoutDelegate;
|
||||
@property (nullable, readonly) id<ASCollectionLayoutDelegate> layoutDelegate;
|
||||
|
||||
@property (nonatomic, weak) id<ASBatchFetchingDelegate> batchFetchingDelegate;
|
||||
@property (nullable, nonatomic, weak) id<ASBatchFetchingDelegate> batchFetchingDelegate;
|
||||
|
||||
/**
|
||||
* When this mode is enabled, ASCollectionView matches the timing of UICollectionView as closely as possible,
|
||||
@ -55,7 +55,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
*
|
||||
* @default defaults to NO.
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL usesSynchronousDataLoading;
|
||||
@property (nonatomic) BOOL usesSynchronousDataLoading;
|
||||
|
||||
/**
|
||||
* Returns YES if the ASCollectionNode contents are completely synchronized with the underlying collection-view layout.
|
||||
|
||||
@ -61,7 +61,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
*
|
||||
* @return view The corresponding ASCollectionView.
|
||||
*/
|
||||
@property (strong, nonatomic, readonly) ASCollectionView *view;
|
||||
@property (readonly) ASCollectionView *view;
|
||||
|
||||
/**
|
||||
* The object that acts as the asynchronous delegate of the collection view
|
||||
@ -71,7 +71,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
* The delegate object is responsible for providing size constraints for nodes and indicating whether batch fetching should begin.
|
||||
* @note This is a convenience method which sets the asyncDelegate on the collection node's collection view.
|
||||
*/
|
||||
@property (weak, nonatomic) id <ASCollectionDelegate> delegate;
|
||||
@property (nullable, weak) id <ASCollectionDelegate> delegate;
|
||||
|
||||
/**
|
||||
* The object that acts as the asynchronous data source of the collection view
|
||||
@ -81,64 +81,64 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
* The datasource object is responsible for providing nodes or node creation blocks to the collection view.
|
||||
* @note This is a convenience method which sets the asyncDatasource on the collection node's collection view.
|
||||
*/
|
||||
@property (weak, nonatomic) id <ASCollectionDataSource> dataSource;
|
||||
@property (nullable, weak) id <ASCollectionDataSource> dataSource;
|
||||
|
||||
/**
|
||||
* The number of screens left to scroll before the delegate -collectionNode:beginBatchFetchingWithContext: is called.
|
||||
*
|
||||
* Defaults to two screenfuls.
|
||||
*/
|
||||
@property (nonatomic, assign) CGFloat leadingScreensForBatching;
|
||||
@property (nonatomic) CGFloat leadingScreensForBatching;
|
||||
|
||||
/*
|
||||
* A Boolean value that determines whether the collection node will be flipped.
|
||||
* If the value of this property is YES, the first cell node will be at the bottom of the collection node (as opposed to the top by default). This is useful for chat/messaging apps. The default value is NO.
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL inverted;
|
||||
@property (nonatomic) BOOL inverted;
|
||||
|
||||
/**
|
||||
* A Boolean value that indicates whether users can select items in the collection node.
|
||||
* If the value of this property is YES (the default), users can select items. If you want more fine-grained control over the selection of items, you must provide a delegate object and implement the appropriate methods of the UICollectionNodeDelegate protocol.
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL allowsSelection;
|
||||
@property (nonatomic) BOOL allowsSelection;
|
||||
|
||||
/**
|
||||
* A Boolean value that determines whether users can select more than one item in the collection node.
|
||||
* This property controls whether multiple items can be selected simultaneously. The default value of this property is NO.
|
||||
* When the value of this property is YES, tapping a cell adds it to the current selection (assuming the delegate permits the cell to be selected). Tapping the cell again removes it from the selection.
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL allowsMultipleSelection;
|
||||
@property (nonatomic) BOOL allowsMultipleSelection;
|
||||
|
||||
/**
|
||||
* A Boolean value that determines whether bouncing always occurs when vertical scrolling reaches the end of the content.
|
||||
* The default value of this property is NO.
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL alwaysBounceVertical;
|
||||
@property (nonatomic) BOOL alwaysBounceVertical;
|
||||
|
||||
/**
|
||||
* A Boolean value that determines whether bouncing always occurs when horizontal scrolling reaches the end of the content view.
|
||||
* The default value of this property is NO.
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL alwaysBounceHorizontal;
|
||||
@property (nonatomic) BOOL alwaysBounceHorizontal;
|
||||
|
||||
/**
|
||||
* A Boolean value that controls whether the vertical scroll indicator is visible.
|
||||
* The default value of this property is YES.
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL showsVerticalScrollIndicator;
|
||||
@property (nonatomic) BOOL showsVerticalScrollIndicator;
|
||||
|
||||
/**
|
||||
* A Boolean value that controls whether the horizontal scroll indicator is visible.
|
||||
* The default value of this property is NO.
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL showsHorizontalScrollIndicator;
|
||||
@property (nonatomic) BOOL showsHorizontalScrollIndicator;
|
||||
|
||||
/**
|
||||
* The layout used to organize the node's items.
|
||||
*
|
||||
* @discussion Assigning a new layout object to this property causes the new layout to be applied (without animations) to the node’s items.
|
||||
*/
|
||||
@property (nonatomic, strong) UICollectionViewLayout *collectionViewLayout;
|
||||
@property (nonatomic) UICollectionViewLayout *collectionViewLayout;
|
||||
|
||||
/**
|
||||
* Optional introspection object for the collection node's layout.
|
||||
@ -155,12 +155,12 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/**
|
||||
* The distance that the content view is inset from the collection node edges. Defaults to UIEdgeInsetsZero.
|
||||
*/
|
||||
@property (nonatomic, assign) UIEdgeInsets contentInset;
|
||||
@property (nonatomic) UIEdgeInsets contentInset;
|
||||
|
||||
/**
|
||||
* The offset of the content view's origin from the collection node's origin. Defaults to CGPointZero.
|
||||
*/
|
||||
@property (nonatomic, assign) CGPoint contentOffset;
|
||||
@property (nonatomic) CGPoint contentOffset;
|
||||
|
||||
/**
|
||||
* Sets the offset from the content node’s origin to the collection node’s origin.
|
||||
@ -428,7 +428,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/**
|
||||
* The index paths of the selected items, or @c nil if no items are selected.
|
||||
*/
|
||||
@property (nonatomic, readonly, nullable) NSArray<NSIndexPath *> *indexPathsForSelectedItems;
|
||||
@property (nullable, nonatomic, copy, readonly) NSArray<NSIndexPath *> *indexPathsForSelectedItems;
|
||||
|
||||
/**
|
||||
* Selects the item at the specified index path and optionally scrolls it into view.
|
||||
|
||||
@ -41,21 +41,21 @@
|
||||
@interface _ASCollectionPendingState : NSObject
|
||||
@property (weak, nonatomic) id <ASCollectionDelegate> delegate;
|
||||
@property (weak, nonatomic) id <ASCollectionDataSource> dataSource;
|
||||
@property (strong, nonatomic) UICollectionViewLayout *collectionViewLayout;
|
||||
@property (nonatomic, assign) ASLayoutRangeMode rangeMode;
|
||||
@property (nonatomic, assign) BOOL allowsSelection; // default is YES
|
||||
@property (nonatomic, assign) BOOL allowsMultipleSelection; // default is NO
|
||||
@property (nonatomic, assign) BOOL inverted; //default is NO
|
||||
@property (nonatomic, assign) BOOL usesSynchronousDataLoading;
|
||||
@property (nonatomic, assign) CGFloat leadingScreensForBatching;
|
||||
@property (nonatomic) UICollectionViewLayout *collectionViewLayout;
|
||||
@property (nonatomic) ASLayoutRangeMode rangeMode;
|
||||
@property (nonatomic) BOOL allowsSelection; // default is YES
|
||||
@property (nonatomic) BOOL allowsMultipleSelection; // default is NO
|
||||
@property (nonatomic) BOOL inverted; //default is NO
|
||||
@property (nonatomic) BOOL usesSynchronousDataLoading;
|
||||
@property (nonatomic) CGFloat leadingScreensForBatching;
|
||||
@property (weak, nonatomic) id <ASCollectionViewLayoutInspecting> layoutInspector;
|
||||
@property (nonatomic, assign) BOOL alwaysBounceVertical;
|
||||
@property (nonatomic, assign) BOOL alwaysBounceHorizontal;
|
||||
@property (nonatomic, assign) UIEdgeInsets contentInset;
|
||||
@property (nonatomic, assign) CGPoint contentOffset;
|
||||
@property (nonatomic, assign) BOOL animatesContentOffset;
|
||||
@property (nonatomic, assign) BOOL showsVerticalScrollIndicator;
|
||||
@property (nonatomic, assign) BOOL showsHorizontalScrollIndicator;
|
||||
@property (nonatomic) BOOL alwaysBounceVertical;
|
||||
@property (nonatomic) BOOL alwaysBounceHorizontal;
|
||||
@property (nonatomic) UIEdgeInsets contentInset;
|
||||
@property (nonatomic) CGPoint contentOffset;
|
||||
@property (nonatomic) BOOL animatesContentOffset;
|
||||
@property (nonatomic) BOOL showsVerticalScrollIndicator;
|
||||
@property (nonatomic) BOOL showsHorizontalScrollIndicator;
|
||||
@end
|
||||
|
||||
@implementation _ASCollectionPendingState
|
||||
|
||||
@ -96,14 +96,14 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/*
|
||||
* A Boolean value that determines whether the nodes that the data source renders will be flipped.
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL inverted ASDISPLAYNODE_DEPRECATED_MSG("Use ASCollectionNode property instead.");
|
||||
@property (nonatomic) BOOL inverted ASDISPLAYNODE_DEPRECATED_MSG("Use ASCollectionNode property instead.");
|
||||
|
||||
/**
|
||||
* The number of screens left to scroll before the delegate -collectionView:beginBatchFetchingWithContext: is called.
|
||||
*
|
||||
* Defaults to two screenfuls.
|
||||
*/
|
||||
@property (nonatomic, assign) CGFloat leadingScreensForBatching ASDISPLAYNODE_DEPRECATED_MSG("Use ASCollectionNode property instead.");
|
||||
@property (nonatomic) CGFloat leadingScreensForBatching ASDISPLAYNODE_DEPRECATED_MSG("Use ASCollectionNode property instead.");
|
||||
|
||||
/**
|
||||
* Optional introspection object for the collection view's layout.
|
||||
@ -144,12 +144,12 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/**
|
||||
* The distance that the content view is inset from the collection view edges. Defaults to UIEdgeInsetsZero.
|
||||
*/
|
||||
@property (nonatomic, assign) UIEdgeInsets contentInset ASDISPLAYNODE_DEPRECATED_MSG("Use ASCollectionNode property instead");
|
||||
@property (nonatomic) UIEdgeInsets contentInset ASDISPLAYNODE_DEPRECATED_MSG("Use ASCollectionNode property instead");
|
||||
|
||||
/**
|
||||
* The point at which the origin of the content view is offset from the origin of the collection view.
|
||||
*/
|
||||
@property (nonatomic, assign) CGPoint contentOffset ASDISPLAYNODE_DEPRECATED_MSG("Use ASCollectionNode property instead.");
|
||||
@property (nonatomic) CGPoint contentOffset ASDISPLAYNODE_DEPRECATED_MSG("Use ASCollectionNode property instead.");
|
||||
|
||||
/**
|
||||
* The object that acts as the asynchronous delegate of the collection view
|
||||
@ -242,9 +242,9 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
- (void)selectItemAtIndexPath:(NSIndexPath *)indexPath animated:(BOOL)animated scrollPosition:(UICollectionViewScrollPosition)scrollPosition ASDISPLAYNODE_DEPRECATED_MSG("Use ASCollectionNode method instead.");
|
||||
|
||||
@property (nonatomic, readonly) NSArray<NSIndexPath *> *indexPathsForVisibleItems ASDISPLAYNODE_DEPRECATED_MSG("Use ASCollectionNode property instead.");
|
||||
@property (nonatomic, copy, readonly) NSArray<NSIndexPath *> *indexPathsForVisibleItems ASDISPLAYNODE_DEPRECATED_MSG("Use ASCollectionNode property instead.");
|
||||
|
||||
@property (nonatomic, readonly, nullable) NSArray<NSIndexPath *> *indexPathsForSelectedItems ASDISPLAYNODE_DEPRECATED_MSG("Use ASCollectionNode property instead.");
|
||||
@property (nullable, nonatomic, copy, readonly) NSArray<NSIndexPath *> *indexPathsForSelectedItems ASDISPLAYNODE_DEPRECATED_MSG("Use ASCollectionNode property instead.");
|
||||
|
||||
/**
|
||||
* Perform a batch of updates asynchronously, optionally disabling all animations in the batch. This method must be called from the main thread.
|
||||
|
||||
@ -35,7 +35,7 @@ AS_SUBCLASSING_RESTRICTED
|
||||
* The delegate for configuration-related events.
|
||||
* Delegate methods are called from a serial queue.
|
||||
*/
|
||||
@property (nonatomic, strong, nullable) id<ASConfigurationDelegate> delegate;
|
||||
@property (nonatomic, nullable) id<ASConfigurationDelegate> delegate;
|
||||
|
||||
/**
|
||||
* The experimental features to enable in Texture.
|
||||
|
||||
@ -69,7 +69,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/**
|
||||
@abstract Settable version of highlighted property.
|
||||
*/
|
||||
@property (nonatomic, readwrite, assign, getter=isHighlighted) BOOL highlighted;
|
||||
@property (getter=isHighlighted) BOOL highlighted;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@ -76,32 +76,32 @@ static UIControlState const ASControlStateSelected ASDISPLAYNODE_DEPRECATED_MSG(
|
||||
@abstract Indicates whether or not the receiver is enabled.
|
||||
@discussion Specify YES to make the control enabled; otherwise, specify NO to make it disabled. The default value is YES. If the enabled state is NO, the control ignores touch events and subclasses may draw differently.
|
||||
*/
|
||||
@property (nonatomic, assign, getter=isEnabled) BOOL enabled;
|
||||
@property (getter=isEnabled) BOOL enabled;
|
||||
|
||||
/**
|
||||
@abstract Indicates whether or not the receiver is highlighted.
|
||||
@discussion This is set automatically when the there is a touch inside the control and removed on exit or touch up. This is different from touchInside in that it includes an area around the control, rather than just for touches inside the control.
|
||||
*/
|
||||
@property (nonatomic, assign, getter=isHighlighted) BOOL highlighted;
|
||||
@property (getter=isHighlighted) BOOL highlighted;
|
||||
|
||||
/**
|
||||
@abstract Indicates whether or not the receiver is highlighted.
|
||||
@discussion This is set automatically when the receiver is tapped.
|
||||
*/
|
||||
@property (nonatomic, assign, getter=isSelected) BOOL selected;
|
||||
@property (getter=isSelected) BOOL selected;
|
||||
|
||||
#pragma mark - Tracking Touches
|
||||
/**
|
||||
@abstract Indicates whether or not the receiver is currently tracking touches related to an event.
|
||||
@discussion YES if the receiver is tracking touches; NO otherwise.
|
||||
*/
|
||||
@property (nonatomic, readonly, assign, getter=isTracking) BOOL tracking;
|
||||
@property (readonly, getter=isTracking) BOOL tracking;
|
||||
|
||||
/**
|
||||
@abstract Indicates whether or not a touch is inside the bounds of the receiver.
|
||||
@discussion YES if a touch is inside the receiver's bounds; NO otherwise.
|
||||
*/
|
||||
@property (nonatomic, readonly, assign, getter=isTouchInside) BOOL touchInside;
|
||||
@property (readonly, getter=isTouchInside) BOOL touchInside;
|
||||
|
||||
#pragma mark - Action Messages
|
||||
/**
|
||||
|
||||
@ -52,8 +52,8 @@
|
||||
}
|
||||
|
||||
// Read-write overrides.
|
||||
@property (nonatomic, readwrite, assign, getter=isTracking) BOOL tracking;
|
||||
@property (nonatomic, readwrite, assign, getter=isTouchInside) BOOL touchInside;
|
||||
@property (getter=isTracking) BOOL tracking;
|
||||
@property (getter=isTouchInside) BOOL touchInside;
|
||||
|
||||
/**
|
||||
@abstract Returns a key to be used in _controlEventDispatchTable that identifies the control event.
|
||||
|
||||
@ -75,28 +75,28 @@ typedef struct {
|
||||
* restoring context if necessary. Restoring can be done in contextDidDisplayNodeContent
|
||||
* This block can be called from *any* thread and it is unsafe to access any UIKit main thread properties from it.
|
||||
*/
|
||||
@property (nonatomic, copy, nullable) ASDisplayNodeContextModifier willDisplayNodeContentWithRenderingContext;
|
||||
@property (nullable) ASDisplayNodeContextModifier willDisplayNodeContentWithRenderingContext;
|
||||
|
||||
/**
|
||||
* @abstract allow modification of a context after the node's content is drawn
|
||||
*/
|
||||
@property (nonatomic, copy, nullable) ASDisplayNodeContextModifier didDisplayNodeContentWithRenderingContext;
|
||||
@property (nullable) ASDisplayNodeContextModifier didDisplayNodeContentWithRenderingContext;
|
||||
|
||||
/**
|
||||
* @abstract A bitmask representing which actions (layout spec, layout generation) should be measured.
|
||||
*/
|
||||
@property (nonatomic, assign) ASDisplayNodePerformanceMeasurementOptions measurementOptions;
|
||||
@property ASDisplayNodePerformanceMeasurementOptions measurementOptions;
|
||||
|
||||
/**
|
||||
* @abstract A simple struct representing performance measurements collected.
|
||||
*/
|
||||
@property (nonatomic, assign, readonly) ASDisplayNodePerformanceMeasurements performanceMeasurements;
|
||||
@property (readonly) ASDisplayNodePerformanceMeasurements performanceMeasurements;
|
||||
|
||||
#if ASEVENTLOG_ENABLE
|
||||
/*
|
||||
* @abstract The primitive event tracing object. You shouldn't directly use it to log event. Use the ASDisplayNodeLogEvent macro instead.
|
||||
*/
|
||||
@property (nonatomic, strong, readonly) ASEventLog *eventLog;
|
||||
@property (nonatomic, readonly) ASEventLog *eventLog;
|
||||
#endif
|
||||
|
||||
/**
|
||||
@ -104,7 +104,7 @@ typedef struct {
|
||||
* an aggregation of all child nodes' accessibility labels. Nodes in this node's subtree that are also accessibility containers will
|
||||
* not be included in this aggregation, and will be exposed as separate accessibility elements to UIKit.
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL isAccessibilityContainer;
|
||||
@property BOOL isAccessibilityContainer;
|
||||
|
||||
/**
|
||||
* @abstract Invoked when a user performs a custom action on an accessible node. Nodes that are children of accessibility containers, have
|
||||
@ -171,7 +171,8 @@ extern void ASDisplayNodePerformBlockOnEveryYogaChild(ASDisplayNode * _Nullable
|
||||
|
||||
@interface ASDisplayNode (Yoga)
|
||||
|
||||
@property (nonatomic, strong, nullable) NSArray *yogaChildren;
|
||||
// TODO: Make this and yogaCalculatedLayout atomic (lock).
|
||||
@property (nullable, nonatomic) NSArray *yogaChildren;
|
||||
|
||||
- (void)addYogaChild:(ASDisplayNode *)child;
|
||||
- (void)removeYogaChild:(ASDisplayNode *)child;
|
||||
@ -179,8 +180,8 @@ extern void ASDisplayNodePerformBlockOnEveryYogaChild(ASDisplayNode * _Nullable
|
||||
|
||||
- (void)semanticContentAttributeDidChange:(UISemanticContentAttribute)attribute;
|
||||
|
||||
@property (nonatomic, assign) BOOL yogaLayoutInProgress;
|
||||
@property (nonatomic, strong, nullable) ASLayout *yogaCalculatedLayout;
|
||||
@property BOOL yogaLayoutInProgress;
|
||||
@property (nullable, nonatomic) ASLayout *yogaCalculatedLayout;
|
||||
|
||||
// These methods are intended to be used internally to Texture, and should not be called directly.
|
||||
- (BOOL)shouldHaveYogaMeasureFunc;
|
||||
@ -194,19 +195,19 @@ extern void ASDisplayNodePerformBlockOnEveryYogaChild(ASDisplayNode * _Nullable
|
||||
- (YGNodeRef)yogaNodeCreateIfNeeded;
|
||||
- (void)destroyYogaNode;
|
||||
|
||||
@property (nonatomic, assign, readonly) YGNodeRef yogaNode;
|
||||
@property (readonly) YGNodeRef yogaNode;
|
||||
|
||||
@property (nonatomic, assign, readwrite) ASStackLayoutDirection flexDirection;
|
||||
@property (nonatomic, assign, readwrite) YGDirection direction;
|
||||
@property (nonatomic, assign, readwrite) ASStackLayoutJustifyContent justifyContent;
|
||||
@property (nonatomic, assign, readwrite) ASStackLayoutAlignItems alignItems;
|
||||
@property (nonatomic, assign, readwrite) YGPositionType positionType;
|
||||
@property (nonatomic, assign, readwrite) ASEdgeInsets position;
|
||||
@property (nonatomic, assign, readwrite) ASEdgeInsets margin;
|
||||
@property (nonatomic, assign, readwrite) ASEdgeInsets padding;
|
||||
@property (nonatomic, assign, readwrite) ASEdgeInsets border;
|
||||
@property (nonatomic, assign, readwrite) CGFloat aspectRatio;
|
||||
@property (nonatomic, assign, readwrite) YGWrap flexWrap;
|
||||
@property ASStackLayoutDirection flexDirection;
|
||||
@property YGDirection direction;
|
||||
@property ASStackLayoutJustifyContent justifyContent;
|
||||
@property ASStackLayoutAlignItems alignItems;
|
||||
@property YGPositionType positionType;
|
||||
@property ASEdgeInsets position;
|
||||
@property ASEdgeInsets margin;
|
||||
@property ASEdgeInsets padding;
|
||||
@property ASEdgeInsets border;
|
||||
@property CGFloat aspectRatio;
|
||||
@property YGWrap flexWrap;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@ -134,7 +134,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
*
|
||||
* @warning Subclasses must not override this; it returns the last cached layout and is never expensive.
|
||||
*/
|
||||
@property (nullable, nonatomic, readonly, strong) ASLayout *calculatedLayout;
|
||||
@property (nullable, readonly) ASLayout *calculatedLayout;
|
||||
|
||||
#pragma mark - View Lifecycle
|
||||
/** @name View Lifecycle */
|
||||
@ -371,7 +371,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/**
|
||||
* @abstract Whether the view or layer of this display node is currently in a window
|
||||
*/
|
||||
@property (nonatomic, readonly, assign, getter=isInHierarchy) BOOL inHierarchy;
|
||||
@property (readonly, getter=isInHierarchy) BOOL inHierarchy;
|
||||
|
||||
/**
|
||||
* Provides an opportunity to clear backing store and other memory-intensive intermediates, such as text layout managers
|
||||
@ -440,7 +440,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
*
|
||||
* @see setNeedsDisplayAtScale:
|
||||
*/
|
||||
@property (nonatomic, assign, readonly) CGFloat contentsScaleForDisplay;
|
||||
@property (readonly) CGFloat contentsScaleForDisplay;
|
||||
|
||||
|
||||
#pragma mark - Touch handling
|
||||
|
||||
@ -61,13 +61,13 @@ typedef void (^ASDisplayNodeContextModifier)(CGContextRef context, id _Nullable
|
||||
/**
|
||||
* ASDisplayNode layout spec block. This block can be used instead of implementing layoutSpecThatFits: in subclass
|
||||
*/
|
||||
typedef ASLayoutSpec * _Nonnull(^ASLayoutSpecBlock)(__kindof ASDisplayNode * _Nonnull node, ASSizeRange constrainedSize);
|
||||
typedef ASLayoutSpec * _Nonnull(^ASLayoutSpecBlock)(__kindof ASDisplayNode *node, ASSizeRange constrainedSize);
|
||||
|
||||
/**
|
||||
* AsyncDisplayKit non-fatal error block. This block can be used for handling non-fatal errors. Useful for reporting
|
||||
* errors that happens in production.
|
||||
*/
|
||||
typedef void (^ASDisplayNodeNonFatalErrorBlock)(__kindof NSError * _Nonnull error);
|
||||
typedef void (^ASDisplayNodeNonFatalErrorBlock)(NSError *error);
|
||||
|
||||
/**
|
||||
* Interface state is available on ASDisplayNode and ASViewController, and
|
||||
@ -221,7 +221,7 @@ extern NSInteger const ASDefaultDrawingPriority;
|
||||
*
|
||||
* @return NO if the node wraps a _ASDisplayView, YES otherwise.
|
||||
*/
|
||||
@property (atomic, readonly, assign, getter=isSynchronous) BOOL synchronous;
|
||||
@property (readonly, getter=isSynchronous) BOOL synchronous;
|
||||
|
||||
/** @name Getting view and layer */
|
||||
|
||||
@ -234,21 +234,21 @@ extern NSInteger const ASDefaultDrawingPriority;
|
||||
* @warning The first access to it must be on the main thread, and should only be used on the main thread thereafter as
|
||||
* well.
|
||||
*/
|
||||
@property (nonatomic, readonly, strong) UIView *view;
|
||||
@property (readonly) UIView *view;
|
||||
|
||||
/**
|
||||
* @abstract Returns whether a node's backing view or layer is loaded.
|
||||
*
|
||||
* @return YES if a view is loaded, or if layerBacked is YES and layer is not nil; NO otherwise.
|
||||
*/
|
||||
@property (nonatomic, readonly, assign, getter=isNodeLoaded) BOOL nodeLoaded;
|
||||
@property (readonly, getter=isNodeLoaded) BOOL nodeLoaded;
|
||||
|
||||
/**
|
||||
* @abstract Returns whether the node rely on a layer instead of a view.
|
||||
*
|
||||
* @return YES if the node rely on a layer, NO otherwise.
|
||||
*/
|
||||
@property (nonatomic, assign, getter=isLayerBacked) BOOL layerBacked;
|
||||
@property (getter=isLayerBacked) BOOL layerBacked;
|
||||
|
||||
/**
|
||||
* @abstract Returns a layer.
|
||||
@ -259,7 +259,7 @@ extern NSInteger const ASDefaultDrawingPriority;
|
||||
* @warning The first access to it must be on the main thread, and should only be used on the main thread thereafter as
|
||||
* well.
|
||||
*/
|
||||
@property (nonatomic, readonly, strong) CALayer * _Nonnull layer;
|
||||
@property (readonly) CALayer * layer;
|
||||
|
||||
/**
|
||||
* Returns YES if the node is – at least partially – visible in a window.
|
||||
@ -299,7 +299,7 @@ extern NSInteger const ASDefaultDrawingPriority;
|
||||
*
|
||||
* @warning This method is not thread-safe.
|
||||
*/
|
||||
@property (nonatomic, class, copy) ASDisplayNodeNonFatalErrorBlock nonFatalErrorBlock;
|
||||
@property (class, nonatomic) ASDisplayNodeNonFatalErrorBlock nonFatalErrorBlock;
|
||||
|
||||
/** @name Managing the nodes hierarchy */
|
||||
|
||||
@ -371,12 +371,12 @@ extern NSInteger const ASDefaultDrawingPriority;
|
||||
/**
|
||||
* @abstract The receiver's immediate subnodes.
|
||||
*/
|
||||
@property (nonatomic, readonly, copy) NSArray<ASDisplayNode *> *subnodes;
|
||||
@property (nullable, readonly, copy) NSArray<ASDisplayNode *> *subnodes;
|
||||
|
||||
/**
|
||||
* @abstract The receiver's supernode.
|
||||
*/
|
||||
@property (nonatomic, readonly, weak) ASDisplayNode *supernode;
|
||||
@property (nullable, readonly, weak) ASDisplayNode *supernode;
|
||||
|
||||
|
||||
/** @name Drawing and Updating the View */
|
||||
@ -409,7 +409,7 @@ extern NSInteger const ASDefaultDrawingPriority;
|
||||
*
|
||||
* Note: this has nothing to do with -[CALayer drawsAsynchronously].
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL displaysAsynchronously;
|
||||
@property BOOL displaysAsynchronously;
|
||||
|
||||
/**
|
||||
* @abstract Prevent the node's layer from displaying.
|
||||
@ -423,12 +423,12 @@ extern NSInteger const ASDefaultDrawingPriority;
|
||||
* If a setNeedsDisplay occurs while displaySuspended is YES, and displaySuspended is set to NO, then the
|
||||
* layer will be automatically displayed.
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL displaySuspended;
|
||||
@property BOOL displaySuspended;
|
||||
|
||||
/**
|
||||
* @abstract Whether size changes should be animated. Default to YES.
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL shouldAnimateSizeChanges;
|
||||
@property BOOL shouldAnimateSizeChanges;
|
||||
|
||||
/**
|
||||
* @abstract Prevent the node and its descendants' layer from displaying.
|
||||
@ -457,14 +457,14 @@ extern NSInteger const ASDefaultDrawingPriority;
|
||||
*
|
||||
* @discussion Defaults to NO.
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL placeholderEnabled;
|
||||
@property BOOL placeholderEnabled;
|
||||
|
||||
/**
|
||||
* @abstract Set the time it takes to fade out the placeholder when a node's contents are finished displaying.
|
||||
*
|
||||
* @discussion Defaults to 0 seconds.
|
||||
*/
|
||||
@property (nonatomic, assign) NSTimeInterval placeholderFadeDuration;
|
||||
@property NSTimeInterval placeholderFadeDuration;
|
||||
|
||||
/**
|
||||
* @abstract Determines drawing priority of the node. Nodes with higher priority will be drawn earlier.
|
||||
@ -472,7 +472,7 @@ extern NSInteger const ASDefaultDrawingPriority;
|
||||
* @discussion Defaults to ASDefaultDrawingPriority. There may be multiple drawing threads, and some of them may
|
||||
* decide to perform operations in queued order (regardless of drawingPriority)
|
||||
*/
|
||||
@property (atomic, assign) NSInteger drawingPriority;
|
||||
@property NSInteger drawingPriority;
|
||||
|
||||
/** @name Hit Testing */
|
||||
|
||||
@ -486,7 +486,7 @@ extern NSInteger const ASDefaultDrawingPriority;
|
||||
* This affects the default implementation of -hitTest and -pointInside, so subclasses should call super if you override
|
||||
* it and want hitTestSlop applied.
|
||||
*/
|
||||
@property (nonatomic, assign) UIEdgeInsets hitTestSlop;
|
||||
@property UIEdgeInsets hitTestSlop;
|
||||
|
||||
/**
|
||||
* @abstract Returns a Boolean value indicating whether the receiver contains the specified point.
|
||||
@ -549,21 +549,21 @@ extern NSInteger const ASDefaultDrawingPriority;
|
||||
/**
|
||||
* Whether or not the node would support having .layerBacked = YES.
|
||||
*/
|
||||
@property (nonatomic, readonly) BOOL supportsLayerBacking;
|
||||
@property (readonly) BOOL supportsLayerBacking;
|
||||
|
||||
/**
|
||||
* Whether or not the node layout should be automatically updated when it receives safeAreaInsetsDidChange.
|
||||
*
|
||||
* Defaults to NO.
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL automaticallyRelayoutOnSafeAreaChanges;
|
||||
@property BOOL automaticallyRelayoutOnSafeAreaChanges;
|
||||
|
||||
/**
|
||||
* Whether or not the node layout should be automatically updated when it receives layoutMarginsDidChange.
|
||||
*
|
||||
* Defaults to NO.
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL automaticallyRelayoutOnLayoutMarginsChanges;
|
||||
@property BOOL automaticallyRelayoutOnLayoutMarginsChanges;
|
||||
|
||||
@end
|
||||
|
||||
@ -573,28 +573,18 @@ extern NSInteger const ASDefaultDrawingPriority;
|
||||
@interface ASDisplayNode (Debugging) <ASDebugNameProvider>
|
||||
|
||||
/**
|
||||
* Set to YES to tell all ASDisplayNode instances to store their unflattened layouts.
|
||||
* Whether or not ASDisplayNode instances should store their unflattened layouts.
|
||||
*
|
||||
* The layout can be accessed via `-unflattenedCalculatedLayout`.
|
||||
*
|
||||
* Flattened layouts use less memory and are faster to lookup. On the other hand, unflattened layouts are useful for debugging
|
||||
* because they preserve original information.
|
||||
*/
|
||||
+ (void)setShouldStoreUnflattenedLayouts:(BOOL)shouldStore;
|
||||
|
||||
/**
|
||||
* Whether or not ASDisplayNode instances should store their unflattened layouts.
|
||||
*
|
||||
* The layout can be accessed via `-unflattenedCalculatedLayout`.
|
||||
*
|
||||
* Flattened layouts use less memory and are faster to lookup. On the other hand, unflattened layouts are useful for debugging
|
||||
* because they preserve original information.
|
||||
*
|
||||
* Defaults to NO.
|
||||
*/
|
||||
+ (BOOL)shouldStoreUnflattenedLayouts;
|
||||
@property (class) BOOL shouldStoreUnflattenedLayouts;
|
||||
|
||||
@property (nonatomic, strong, readonly, nullable) ASLayout *unflattenedCalculatedLayout;
|
||||
@property (nullable, readonly) ASLayout *unflattenedCalculatedLayout;
|
||||
|
||||
/**
|
||||
* @abstract Return a description of the node hierarchy.
|
||||
@ -606,7 +596,7 @@ extern NSInteger const ASDefaultDrawingPriority;
|
||||
/**
|
||||
* A detailed description of this node's layout state. This is useful when debugging.
|
||||
*/
|
||||
@property (atomic, copy, readonly) NSString *detailedLayoutDescription;
|
||||
@property (copy, readonly) NSString *detailedLayoutDescription;
|
||||
|
||||
@end
|
||||
|
||||
@ -645,10 +635,10 @@ extern NSInteger const ASDefaultDrawingPriority;
|
||||
*/
|
||||
- (void)layoutIfNeeded;
|
||||
|
||||
@property (nonatomic, assign) CGRect frame; // default=CGRectZero
|
||||
@property (nonatomic, assign) CGRect bounds; // default=CGRectZero
|
||||
@property (nonatomic, assign) CGPoint position; // default=CGPointZero
|
||||
@property (nonatomic, assign) CGFloat alpha; // default=1.0f
|
||||
@property CGRect frame; // default=CGRectZero
|
||||
@property CGRect bounds; // default=CGRectZero
|
||||
@property CGPoint position; // default=CGPointZero
|
||||
@property CGFloat alpha; // default=1.0f
|
||||
|
||||
/* @abstract Sets the corner rounding method to use on the ASDisplayNode.
|
||||
* There are three types of corner rounding provided by Texture: CALayer, Precomposited, and Clipping.
|
||||
@ -672,33 +662,33 @@ extern NSInteger const ASDefaultDrawingPriority;
|
||||
*
|
||||
* @default ASCornerRoundingTypeDefaultSlowCALayer
|
||||
*/
|
||||
@property (nonatomic, assign) ASCornerRoundingType cornerRoundingType; // default=Slow CALayer .cornerRadius (offscreen rendering)
|
||||
@property ASCornerRoundingType cornerRoundingType; // default=Slow CALayer .cornerRadius (offscreen rendering)
|
||||
|
||||
/** @abstract The radius to use when rounding corners of the ASDisplayNode.
|
||||
*
|
||||
* @discussion This property is thread-safe and should always be preferred over CALayer's cornerRadius property,
|
||||
* even if corner rounding type is ASCornerRoundingTypeDefaultSlowCALayer.
|
||||
*/
|
||||
@property (nonatomic, assign) CGFloat cornerRadius; // default=0.0
|
||||
@property CGFloat cornerRadius; // default=0.0
|
||||
|
||||
@property (nonatomic, assign) BOOL clipsToBounds; // default==NO
|
||||
@property (nonatomic, getter=isHidden) BOOL hidden; // default==NO
|
||||
@property (nonatomic, getter=isOpaque) BOOL opaque; // default==YES
|
||||
@property BOOL clipsToBounds; // default==NO
|
||||
@property (getter=isHidden) BOOL hidden; // default==NO
|
||||
@property (getter=isOpaque) BOOL opaque; // default==YES
|
||||
|
||||
@property (nonatomic, strong, nullable) id contents; // default=nil
|
||||
@property (nonatomic, assign) CGRect contentsRect; // default={0,0,1,1}. @see CALayer.h for details.
|
||||
@property (nonatomic, assign) CGRect contentsCenter; // default={0,0,1,1}. @see CALayer.h for details.
|
||||
@property (nonatomic, assign) CGFloat contentsScale; // default=1.0f. See @contentsScaleForDisplay for details.
|
||||
@property (nonatomic, assign) CGFloat rasterizationScale; // default=1.0f.
|
||||
@property (nullable) id contents; // default=nil
|
||||
@property CGRect contentsRect; // default={0,0,1,1}. @see CALayer.h for details.
|
||||
@property CGRect contentsCenter; // default={0,0,1,1}. @see CALayer.h for details.
|
||||
@property CGFloat contentsScale; // default=1.0f. See @contentsScaleForDisplay for details.
|
||||
@property CGFloat rasterizationScale; // default=1.0f.
|
||||
|
||||
@property (nonatomic, assign) CGPoint anchorPoint; // default={0.5, 0.5}
|
||||
@property (nonatomic, assign) CGFloat zPosition; // default=0.0
|
||||
@property (nonatomic, assign) CATransform3D transform; // default=CATransform3DIdentity
|
||||
@property (nonatomic, assign) CATransform3D subnodeTransform; // default=CATransform3DIdentity
|
||||
@property CGPoint anchorPoint; // default={0.5, 0.5}
|
||||
@property CGFloat zPosition; // default=0.0
|
||||
@property CATransform3D transform; // default=CATransform3DIdentity
|
||||
@property CATransform3D subnodeTransform; // default=CATransform3DIdentity
|
||||
|
||||
@property (nonatomic, assign, getter=isUserInteractionEnabled) BOOL userInteractionEnabled; // default=YES (NO for layer-backed nodes)
|
||||
@property (getter=isUserInteractionEnabled) BOOL userInteractionEnabled; // default=YES (NO for layer-backed nodes)
|
||||
#if TARGET_OS_IOS
|
||||
@property (nonatomic, assign, getter=isExclusiveTouch) BOOL exclusiveTouch; // default=NO
|
||||
@property (getter=isExclusiveTouch) BOOL exclusiveTouch; // default=NO
|
||||
#endif
|
||||
|
||||
/**
|
||||
@ -707,9 +697,9 @@ extern NSInteger const ASDefaultDrawingPriority;
|
||||
* @discussion In contrast to UIView, setting a transparent color will not set opaque = NO.
|
||||
* This only affects nodes that implement +drawRect like ASTextNode.
|
||||
*/
|
||||
@property (nonatomic, strong, nullable) UIColor *backgroundColor; // default=nil
|
||||
@property (nullable, copy) UIColor *backgroundColor; // default=nil
|
||||
|
||||
@property (nonatomic, strong, null_resettable) UIColor *tintColor; // default=Blue
|
||||
@property (null_resettable, copy) UIColor *tintColor; // default=Blue
|
||||
- (void)tintColorDidChange; // Notifies the node when the tintColor has changed.
|
||||
|
||||
/**
|
||||
@ -720,24 +710,24 @@ extern NSInteger const ASDefaultDrawingPriority;
|
||||
* Thus, UIViewContentModeRedraw is not allowed; use needsDisplayOnBoundsChange = YES instead, and pick an appropriate
|
||||
* contentMode for your content while it's being re-rendered.
|
||||
*/
|
||||
@property (nonatomic, assign) UIViewContentMode contentMode; // default=UIViewContentModeScaleToFill
|
||||
@property (nonatomic, copy) NSString *contentsGravity; // Use .contentMode in preference when possible.
|
||||
@property (nonatomic, assign) UISemanticContentAttribute semanticContentAttribute API_AVAILABLE(ios(9.0), tvos(9.0)); // default=Unspecified
|
||||
@property UIViewContentMode contentMode; // default=UIViewContentModeScaleToFill
|
||||
@property (copy) NSString *contentsGravity; // Use .contentMode in preference when possible.
|
||||
@property UISemanticContentAttribute semanticContentAttribute;
|
||||
|
||||
@property (nonatomic, nullable) CGColorRef shadowColor; // default=opaque rgb black
|
||||
@property (nonatomic, assign) CGFloat shadowOpacity; // default=0.0
|
||||
@property (nonatomic, assign) CGSize shadowOffset; // default=(0, -3)
|
||||
@property (nonatomic, assign) CGFloat shadowRadius; // default=3
|
||||
@property (nonatomic, assign) CGFloat borderWidth; // default=0
|
||||
@property (nonatomic, nullable) CGColorRef borderColor; // default=opaque rgb black
|
||||
@property (nullable) CGColorRef shadowColor; // default=opaque rgb black
|
||||
@property CGFloat shadowOpacity; // default=0.0
|
||||
@property CGSize shadowOffset; // default=(0, -3)
|
||||
@property CGFloat shadowRadius; // default=3
|
||||
@property CGFloat borderWidth; // default=0
|
||||
@property (nullable) CGColorRef borderColor; // default=opaque rgb black
|
||||
|
||||
@property (nonatomic, assign) BOOL allowsGroupOpacity;
|
||||
@property (nonatomic, assign) BOOL allowsEdgeAntialiasing;
|
||||
@property (nonatomic, assign) unsigned int edgeAntialiasingMask; // default==all values from CAEdgeAntialiasingMask
|
||||
@property BOOL allowsGroupOpacity;
|
||||
@property BOOL allowsEdgeAntialiasing;
|
||||
@property unsigned int edgeAntialiasingMask; // default==all values from CAEdgeAntialiasingMask
|
||||
|
||||
@property (nonatomic, assign) BOOL needsDisplayOnBoundsChange; // default==NO
|
||||
@property (nonatomic, assign) BOOL autoresizesSubviews; // default==YES (undefined for layer-backed nodes)
|
||||
@property (nonatomic, assign) UIViewAutoresizing autoresizingMask; // default==UIViewAutoresizingNone (undefined for layer-backed nodes)
|
||||
@property BOOL needsDisplayOnBoundsChange; // default==NO
|
||||
@property BOOL autoresizesSubviews; // default==YES (undefined for layer-backed nodes)
|
||||
@property UIViewAutoresizing autoresizingMask; // default==UIViewAutoresizingNone (undefined for layer-backed nodes)
|
||||
|
||||
/**
|
||||
* @abstract Content margins
|
||||
@ -748,8 +738,8 @@ extern NSInteger const ASDefaultDrawingPriority;
|
||||
* that the layout gets automatically updated when the value of this property changes. Or you can override layoutMarginsDidChange
|
||||
* and make all the necessary updates manually.
|
||||
*/
|
||||
@property (nonatomic, assign) UIEdgeInsets layoutMargins;
|
||||
@property (nonatomic, assign) BOOL preservesSuperviewLayoutMargins; // default is NO - set to enable pass-through or cascading behavior of margins from this view’s parent to its children
|
||||
@property UIEdgeInsets layoutMargins;
|
||||
@property BOOL preservesSuperviewLayoutMargins; // default is NO - set to enable pass-through or cascading behavior of margins from this view’s parent to its children
|
||||
- (void)layoutMarginsDidChange;
|
||||
|
||||
/**
|
||||
@ -761,8 +751,8 @@ extern NSInteger const ASDefaultDrawingPriority;
|
||||
* that the layout gets automatically updated when the value of this property changes. Or you can override safeAreaInsetsDidChange
|
||||
* and make all the necessary updates manually.
|
||||
*/
|
||||
@property (nonatomic, readonly) UIEdgeInsets safeAreaInsets;
|
||||
@property (nonatomic, assign) BOOL insetsLayoutMarginsFromSafeArea; // Default: YES
|
||||
@property (readonly) UIEdgeInsets safeAreaInsets;
|
||||
@property BOOL insetsLayoutMarginsFromSafeArea; // Default: YES
|
||||
- (void)safeAreaInsetsDidChange;
|
||||
|
||||
|
||||
@ -773,15 +763,15 @@ extern NSInteger const ASDefaultDrawingPriority;
|
||||
- (BOOL)canResignFirstResponder; // default==YES
|
||||
- (BOOL)resignFirstResponder; // default==NO (no-op)
|
||||
- (BOOL)isFirstResponder;
|
||||
- (BOOL)canPerformAction:(nonnull SEL)action withSender:(nonnull id)sender;
|
||||
- (BOOL)canPerformAction:(SEL)action withSender:(id)sender;
|
||||
|
||||
#if TARGET_OS_TV
|
||||
//Focus Engine
|
||||
- (void)setNeedsFocusUpdate;
|
||||
- (BOOL)canBecomeFocused;
|
||||
- (void)updateFocusIfNeeded;
|
||||
- (void)didUpdateFocusInContext:(nonnull UIFocusUpdateContext *)context withAnimationCoordinator:(nonnull UIFocusAnimationCoordinator *)coordinator;
|
||||
- (BOOL)shouldUpdateFocusInContext:(nonnull UIFocusUpdateContext *)context;
|
||||
- (void)didUpdateFocusInContext:(UIFocusUpdateContext *)context withAnimationCoordinator:(UIFocusAnimationCoordinator *)coordinator;
|
||||
- (BOOL)shouldUpdateFocusInContext:(UIFocusUpdateContext *)context;
|
||||
- (nullable UIView *)preferredFocusedView;
|
||||
#endif
|
||||
|
||||
@ -790,28 +780,28 @@ extern NSInteger const ASDefaultDrawingPriority;
|
||||
@interface ASDisplayNode (UIViewBridgeAccessibility)
|
||||
|
||||
// Accessibility support
|
||||
@property (nonatomic, assign) BOOL isAccessibilityElement;
|
||||
@property (nonatomic, copy, nullable) NSString *accessibilityLabel;
|
||||
@property (nonatomic, copy, nullable) NSAttributedString *accessibilityAttributedLabel API_AVAILABLE(ios(11.0),tvos(11.0));
|
||||
@property (nonatomic, copy, nullable) NSString *accessibilityHint;
|
||||
@property (nonatomic, copy, nullable) NSAttributedString *accessibilityAttributedHint API_AVAILABLE(ios(11.0),tvos(11.0));
|
||||
@property (nonatomic, copy, nullable) NSString *accessibilityValue;
|
||||
@property (nonatomic, copy, nullable) NSAttributedString *accessibilityAttributedValue API_AVAILABLE(ios(11.0),tvos(11.0));
|
||||
@property (nonatomic, assign) UIAccessibilityTraits accessibilityTraits;
|
||||
@property (nonatomic, assign) CGRect accessibilityFrame;
|
||||
@property (nonatomic, copy, nullable) UIBezierPath *accessibilityPath;
|
||||
@property (nonatomic, assign) CGPoint accessibilityActivationPoint;
|
||||
@property (nonatomic, copy, nullable) NSString *accessibilityLanguage;
|
||||
@property (nonatomic, assign) BOOL accessibilityElementsHidden;
|
||||
@property (nonatomic, assign) BOOL accessibilityViewIsModal;
|
||||
@property (nonatomic, assign) BOOL shouldGroupAccessibilityChildren;
|
||||
@property (nonatomic, assign) UIAccessibilityNavigationStyle accessibilityNavigationStyle;
|
||||
@property BOOL isAccessibilityElement;
|
||||
@property (nullable, copy) NSString *accessibilityLabel;
|
||||
@property (nullable, copy) NSAttributedString *accessibilityAttributedLabel API_AVAILABLE(ios(11.0),tvos(11.0));
|
||||
@property (nullable, copy) NSString *accessibilityHint;
|
||||
@property (nullable, copy) NSAttributedString *accessibilityAttributedHint API_AVAILABLE(ios(11.0),tvos(11.0));
|
||||
@property (nullable, copy) NSString *accessibilityValue;
|
||||
@property (nullable, copy) NSAttributedString *accessibilityAttributedValue API_AVAILABLE(ios(11.0),tvos(11.0));
|
||||
@property UIAccessibilityTraits accessibilityTraits;
|
||||
@property CGRect accessibilityFrame;
|
||||
@property (nullable, copy) UIBezierPath *accessibilityPath;
|
||||
@property CGPoint accessibilityActivationPoint;
|
||||
@property (nullable, copy) NSString *accessibilityLanguage;
|
||||
@property BOOL accessibilityElementsHidden;
|
||||
@property BOOL accessibilityViewIsModal;
|
||||
@property BOOL shouldGroupAccessibilityChildren;
|
||||
@property UIAccessibilityNavigationStyle accessibilityNavigationStyle;
|
||||
#if TARGET_OS_TV
|
||||
@property(nonatomic, copy, nullable) NSArray *accessibilityHeaderElements;
|
||||
@property (nullable, copy) NSArray *accessibilityHeaderElements;
|
||||
#endif
|
||||
|
||||
// Accessibility identification support
|
||||
@property (nonatomic, copy, nullable) NSString *accessibilityIdentifier;
|
||||
@property (nullable, copy) NSString *accessibilityIdentifier;
|
||||
|
||||
@end
|
||||
|
||||
@ -858,7 +848,7 @@ extern NSInteger const ASDefaultDrawingPriority;
|
||||
*
|
||||
* @code ^ASLayoutSpec *(__kindof ASDisplayNode * _Nonnull node, ASSizeRange constrainedSize) {};
|
||||
*/
|
||||
@property (nonatomic, readwrite, copy, nullable) ASLayoutSpecBlock layoutSpecBlock;
|
||||
@property (nullable) ASLayoutSpecBlock layoutSpecBlock;
|
||||
|
||||
/**
|
||||
* @abstract Return the calculated size.
|
||||
@ -870,14 +860,14 @@ extern NSInteger const ASDefaultDrawingPriority;
|
||||
*
|
||||
* @warning Subclasses must not override this; it returns the last cached measurement and is never expensive.
|
||||
*/
|
||||
@property (nonatomic, readonly, assign) CGSize calculatedSize;
|
||||
@property (readonly) CGSize calculatedSize;
|
||||
|
||||
/**
|
||||
* @abstract Return the constrained size range used for calculating layout.
|
||||
*
|
||||
* @return The minimum and maximum constrained sizes used by calculateLayoutThatFits:.
|
||||
*/
|
||||
@property (nonatomic, readonly, assign) ASSizeRange constrainedSizeForCalculatedLayout;
|
||||
@property (readonly) ASSizeRange constrainedSizeForCalculatedLayout;
|
||||
|
||||
|
||||
@end
|
||||
@ -887,19 +877,19 @@ extern NSInteger const ASDefaultDrawingPriority;
|
||||
/**
|
||||
* @abstract The amount of time it takes to complete the default transition animation. Default is 0.2.
|
||||
*/
|
||||
@property (nonatomic, assign) NSTimeInterval defaultLayoutTransitionDuration;
|
||||
@property NSTimeInterval defaultLayoutTransitionDuration;
|
||||
|
||||
/**
|
||||
* @abstract The amount of time (measured in seconds) to wait before beginning the default transition animation.
|
||||
* Default is 0.0.
|
||||
*/
|
||||
@property (nonatomic, assign) NSTimeInterval defaultLayoutTransitionDelay;
|
||||
@property NSTimeInterval defaultLayoutTransitionDelay;
|
||||
|
||||
/**
|
||||
* @abstract A mask of options indicating how you want to perform the default transition animations.
|
||||
* For a list of valid constants, see UIViewAnimationOptions.
|
||||
*/
|
||||
@property (nonatomic, assign) UIViewAnimationOptions defaultLayoutTransitionOptions;
|
||||
@property UIViewAnimationOptions defaultLayoutTransitionOptions;
|
||||
|
||||
/**
|
||||
* @discussion A place to perform your animation. New nodes have been inserted here. You can also use this time to re-order the hierarchy.
|
||||
@ -965,7 +955,7 @@ extern NSInteger const ASDefaultDrawingPriority;
|
||||
* @discussion If flag is YES the node no longer require addSubnode: or removeFromSupernode method calls. The presence
|
||||
* or absence of subnodes is completely determined in its layoutSpecThatFits: method.
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL automaticallyManagesSubnodes;
|
||||
@property BOOL automaticallyManagesSubnodes;
|
||||
|
||||
@end
|
||||
|
||||
@ -983,7 +973,7 @@ extern NSInteger const ASDefaultDrawingPriority;
|
||||
*
|
||||
* @param node The node to be added.
|
||||
*/
|
||||
- (void)addSubnode:(nonnull ASDisplayNode *)node;
|
||||
- (void)addSubnode:(ASDisplayNode *)node;
|
||||
@end
|
||||
|
||||
/*
|
||||
@ -995,7 +985,7 @@ extern NSInteger const ASDefaultDrawingPriority;
|
||||
*
|
||||
* @param node The node to be added.
|
||||
*/
|
||||
- (void)addSubnode:(nonnull ASDisplayNode *)node;
|
||||
- (void)addSubnode:(ASDisplayNode *)node;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@ -48,7 +48,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
placeholderTextKitComponents:(ASTextKitComponents *)placeholderTextKitComponents;
|
||||
|
||||
//! @abstract The text node's delegate, which must conform to the <ASEditableTextNodeDelegate> protocol.
|
||||
@property (nonatomic, readwrite, weak) id <ASEditableTextNodeDelegate> delegate;
|
||||
@property (nullable, weak) id <ASEditableTextNodeDelegate> delegate;
|
||||
|
||||
#pragma mark - Configuration
|
||||
|
||||
@ -62,13 +62,13 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@abstract Access to underlying UITextView for more configuration options.
|
||||
@warning This property should only be used on the main thread and should not be accessed before the editable text node's view is created.
|
||||
*/
|
||||
@property (nonatomic, readonly, strong) UITextView *textView;
|
||||
@property (nonatomic, readonly) UITextView *textView;
|
||||
|
||||
//! @abstract The attributes to apply to new text being entered by the user.
|
||||
@property (nonatomic, readwrite, strong, nullable) NSDictionary<NSString *, id> *typingAttributes;
|
||||
@property (nullable, nonatomic, copy) NSDictionary<NSString *, id> *typingAttributes;
|
||||
|
||||
//! @abstract The range of text currently selected. If length is zero, the range is the cursor location.
|
||||
@property (nonatomic, readwrite, assign) NSRange selectedRange;
|
||||
@property NSRange selectedRange;
|
||||
|
||||
#pragma mark - Placeholder
|
||||
/**
|
||||
@ -82,14 +82,14 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@abstract The styled placeholder text displayed by the text node while no text is entered
|
||||
@discussion The placeholder is displayed when the user has not entered any text and the keyboard is not visible.
|
||||
*/
|
||||
@property (nonatomic, readwrite, strong, nullable) NSAttributedString *attributedPlaceholderText;
|
||||
@property (nullable, nonatomic, copy) NSAttributedString *attributedPlaceholderText;
|
||||
|
||||
#pragma mark - Modifying User Text
|
||||
/**
|
||||
@abstract The styled text displayed by the receiver.
|
||||
@discussion When the placeholder is displayed (as indicated by -isDisplayingPlaceholder), this value is nil. Otherwise, this value is the attributed text the user has entered. This value can be modified regardless of whether the receiver is the first responder (and thus, editing) or not. Changing this value from nil to non-nil will result in the placeholder being hidden, and the new value being displayed.
|
||||
*/
|
||||
@property (nonatomic, readwrite, copy, nullable) NSAttributedString *attributedText;
|
||||
@property (nullable, nonatomic, copy) NSAttributedString *attributedText;
|
||||
|
||||
#pragma mark - Managing The Keyboard
|
||||
//! @abstract The text input mode used by the receiver's keyboard, if it is visible. This value is undefined if the receiver is not the first responder.
|
||||
@ -98,13 +98,13 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/**
|
||||
@abstract The textContainerInset of both the placeholder and typed textView. This value defaults to UIEdgeInsetsZero.
|
||||
*/
|
||||
@property (nonatomic, readwrite) UIEdgeInsets textContainerInset;
|
||||
@property (nonatomic) UIEdgeInsets textContainerInset;
|
||||
|
||||
/**
|
||||
@abstract The maximum number of lines to display. Additional lines will require scrolling.
|
||||
@default 0 (No limit)
|
||||
*/
|
||||
@property (nonatomic, assign) NSUInteger maximumLinesToDisplay;
|
||||
@property (nonatomic) NSUInteger maximumLinesToDisplay;
|
||||
|
||||
/**
|
||||
@abstract Indicates whether the receiver's text view is the first responder, and thus has the keyboard visible and is prepared for editing by the user.
|
||||
@ -130,22 +130,22 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/**
|
||||
@abstract <UITextInputTraits> properties.
|
||||
*/
|
||||
@property(nonatomic, readwrite, assign) UITextAutocapitalizationType autocapitalizationType; // default is UITextAutocapitalizationTypeSentences
|
||||
@property(nonatomic, readwrite, assign) UITextAutocorrectionType autocorrectionType; // default is UITextAutocorrectionTypeDefault
|
||||
@property(nonatomic, readwrite, assign) UITextSpellCheckingType spellCheckingType; // default is UITextSpellCheckingTypeDefault;
|
||||
@property(nonatomic, readwrite, assign) UIKeyboardType keyboardType; // default is UIKeyboardTypeDefault
|
||||
@property(nonatomic, readwrite, assign) UIKeyboardAppearance keyboardAppearance; // default is UIKeyboardAppearanceDefault
|
||||
@property(nonatomic, readwrite, assign) UIReturnKeyType returnKeyType; // default is UIReturnKeyDefault (See note under UIReturnKeyType enum)
|
||||
@property(nonatomic, readwrite, assign) BOOL enablesReturnKeyAutomatically; // default is NO (when YES, will automatically disable return key when text widget has zero-length contents, and will automatically enable when text widget has non-zero-length contents)
|
||||
@property(nonatomic, readwrite, assign, getter=isSecureTextEntry) BOOL secureTextEntry; // default is NO
|
||||
@property (nonatomic) UITextAutocapitalizationType autocapitalizationType; // default is UITextAutocapitalizationTypeSentences
|
||||
@property (nonatomic) UITextAutocorrectionType autocorrectionType; // default is UITextAutocorrectionTypeDefault
|
||||
@property (nonatomic) UITextSpellCheckingType spellCheckingType; // default is UITextSpellCheckingTypeDefault;
|
||||
@property (nonatomic) UIKeyboardType keyboardType; // default is UIKeyboardTypeDefault
|
||||
@property (nonatomic) UIKeyboardAppearance keyboardAppearance; // default is UIKeyboardAppearanceDefault
|
||||
@property (nonatomic) UIReturnKeyType returnKeyType; // default is UIReturnKeyDefault (See note under UIReturnKeyType enum)
|
||||
@property (nonatomic) BOOL enablesReturnKeyAutomatically; // default is NO (when YES, will automatically disable return key when text widget has zero-length contents, and will automatically enable when text widget has non-zero-length contents)
|
||||
@property (nonatomic, getter=isSecureTextEntry) BOOL secureTextEntry; // default is NO
|
||||
|
||||
@end
|
||||
|
||||
@interface ASEditableTextNode (Unavailable)
|
||||
|
||||
- (instancetype)initWithLayerBlock:(ASDisplayNodeLayerBlock)viewBlock didLoadBlock:(nullable ASDisplayNodeDidLoadBlock)didLoadBlock __unavailable;
|
||||
- (instancetype)initWithLayerBlock:(ASDisplayNodeLayerBlock)viewBlock didLoadBlock:(nullable ASDisplayNodeDidLoadBlock)didLoadBlock NS_UNAVAILABLE;
|
||||
|
||||
- (instancetype)initWithViewBlock:(ASDisplayNodeViewBlock)viewBlock didLoadBlock:(nullable ASDisplayNodeDidLoadBlock)didLoadBlock __unavailable;
|
||||
- (instancetype)initWithViewBlock:(ASDisplayNodeViewBlock)viewBlock didLoadBlock:(nullable ASDisplayNodeDidLoadBlock)didLoadBlock NS_UNAVAILABLE;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@ -31,14 +31,14 @@
|
||||
**/
|
||||
@interface _ASTextInputTraitsPendingState : NSObject
|
||||
|
||||
@property (nonatomic, readwrite, assign) UITextAutocapitalizationType autocapitalizationType;
|
||||
@property (nonatomic, readwrite, assign) UITextAutocorrectionType autocorrectionType;
|
||||
@property (nonatomic, readwrite, assign) UITextSpellCheckingType spellCheckingType;
|
||||
@property (nonatomic, readwrite, assign) UIKeyboardAppearance keyboardAppearance;
|
||||
@property (nonatomic, readwrite, assign) UIKeyboardType keyboardType;
|
||||
@property (nonatomic, readwrite, assign) UIReturnKeyType returnKeyType;
|
||||
@property (nonatomic, readwrite, assign) BOOL enablesReturnKeyAutomatically;
|
||||
@property (nonatomic, readwrite, assign, getter=isSecureTextEntry) BOOL secureTextEntry;
|
||||
@property UITextAutocapitalizationType autocapitalizationType;
|
||||
@property UITextAutocorrectionType autocorrectionType;
|
||||
@property UITextSpellCheckingType spellCheckingType;
|
||||
@property UIKeyboardAppearance keyboardAppearance;
|
||||
@property UIKeyboardType keyboardType;
|
||||
@property UIReturnKeyType returnKeyType;
|
||||
@property BOOL enablesReturnKeyAutomatically;
|
||||
@property (getter=isSecureTextEntry) BOOL secureTextEntry;
|
||||
|
||||
@end
|
||||
|
||||
@ -142,7 +142,7 @@
|
||||
NSRange _previousSelectedRange;
|
||||
}
|
||||
|
||||
@property (nonatomic, strong, readonly) _ASTextInputTraitsPendingState *textInputTraits;
|
||||
@property (nonatomic, readonly) _ASTextInputTraitsPendingState *textInputTraits;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@ -171,7 +171,7 @@ NSString *const ASAnimatedImageDefaultRunLoopMode = NSRunLoopCommonModes;
|
||||
[_displayLink removeFromRunLoop:[NSRunLoop mainRunLoop] forMode:_animatedImageRunLoopMode];
|
||||
[_displayLink addToRunLoop:[NSRunLoop mainRunLoop] forMode:runLoopMode];
|
||||
}
|
||||
_animatedImageRunLoopMode = runLoopMode;
|
||||
_animatedImageRunLoopMode = [runLoopMode copy];
|
||||
}
|
||||
|
||||
- (void)setShouldAnimate:(BOOL)shouldAnimate
|
||||
|
||||
@ -45,12 +45,12 @@ typedef UIImage * _Nullable (^asimagenode_modification_block_t)(UIImage *image);
|
||||
* the layer's contentsCenter property. Non-stretchable images work too, of
|
||||
* course.
|
||||
*/
|
||||
@property (nullable, nonatomic, strong) UIImage *image;
|
||||
@property (nullable) UIImage *image;
|
||||
|
||||
/**
|
||||
@abstract The placeholder color.
|
||||
*/
|
||||
@property (nullable, nonatomic, strong) UIColor *placeholderColor;
|
||||
@property (nullable, copy) UIColor *placeholderColor;
|
||||
|
||||
/**
|
||||
* @abstract Indicates whether efficient cropping of the receiver is enabled.
|
||||
@ -58,7 +58,7 @@ typedef UIImage * _Nullable (^asimagenode_modification_block_t)(UIImage *image);
|
||||
* @discussion Defaults to YES. See -setCropEnabled:recropImmediately:inBounds: for more
|
||||
* information.
|
||||
*/
|
||||
@property (nonatomic, assign, getter=isCropEnabled) BOOL cropEnabled;
|
||||
@property (getter=isCropEnabled) BOOL cropEnabled;
|
||||
|
||||
/**
|
||||
* @abstract Indicates that efficient downsizing of backing store should *not* be enabled.
|
||||
@ -66,7 +66,7 @@ typedef UIImage * _Nullable (^asimagenode_modification_block_t)(UIImage *image);
|
||||
* @discussion Defaults to NO. @see ASCroppedImageBackingSizeAndDrawRectInBounds for more
|
||||
* information.
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL forceUpscaling;
|
||||
@property BOOL forceUpscaling;
|
||||
|
||||
/**
|
||||
* @abstract Forces image to be rendered at forcedSize.
|
||||
@ -74,7 +74,7 @@ typedef UIImage * _Nullable (^asimagenode_modification_block_t)(UIImage *image);
|
||||
* Setting forcedSize to non-CGSizeZero will force the backing of the layer contents to
|
||||
* be forcedSize (automatically adjusted for contentsSize).
|
||||
*/
|
||||
@property (nonatomic, assign) CGSize forcedSize;
|
||||
@property CGSize forcedSize;
|
||||
|
||||
/**
|
||||
* @abstract Enables or disables efficient cropping.
|
||||
@ -105,7 +105,7 @@ typedef UIImage * _Nullable (^asimagenode_modification_block_t)(UIImage *image);
|
||||
* dimensions, and only the cropRect's origin will be used for positioning. The
|
||||
* default value of this property is CGRectMake(0.5, 0.5, 0.0, 0.0).
|
||||
*/
|
||||
@property (nonatomic, readwrite, assign) CGRect cropRect;
|
||||
@property CGRect cropRect;
|
||||
|
||||
/**
|
||||
* @abstract An optional block which can perform drawing operations on image
|
||||
@ -114,7 +114,7 @@ typedef UIImage * _Nullable (^asimagenode_modification_block_t)(UIImage *image);
|
||||
* @discussion Can be used to add image effects (such as rounding, adding
|
||||
* borders, or other pattern overlays) without extraneous display calls.
|
||||
*/
|
||||
@property (nullable, nonatomic, readwrite, copy) asimagenode_modification_block_t imageModificationBlock;
|
||||
@property (nullable) asimagenode_modification_block_t imageModificationBlock;
|
||||
|
||||
/**
|
||||
* @abstract Marks the receiver as needing display and performs a block after
|
||||
@ -136,7 +136,7 @@ typedef UIImage * _Nullable (^asimagenode_modification_block_t)(UIImage *image);
|
||||
* is the default focus appearance.
|
||||
* Exposed here so the category methods can set it.
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL isDefaultFocusAppearance;
|
||||
@property BOOL isDefaultFocusAppearance;
|
||||
#endif
|
||||
|
||||
@end
|
||||
@ -157,7 +157,7 @@ typedef UIImage * _Nullable (^asimagenode_modification_block_t)(UIImage *image);
|
||||
* another method is used internally. If you need to know when the animatedImage
|
||||
* is set, override @c animatedImageSet:previousAnimatedImage:
|
||||
*/
|
||||
@property (nullable, nonatomic, strong) id <ASAnimatedImageProtocol> animatedImage;
|
||||
@property (nullable) id <ASAnimatedImageProtocol> animatedImage;
|
||||
|
||||
/**
|
||||
* @abstract Pause the playback of an animated image.
|
||||
@ -165,7 +165,7 @@ typedef UIImage * _Nullable (^asimagenode_modification_block_t)(UIImage *image);
|
||||
* @discussion Set to YES to pause playback of an animated image and NO to resume
|
||||
* playback.
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL animatedImagePaused;
|
||||
@property BOOL animatedImagePaused;
|
||||
|
||||
/**
|
||||
* @abstract The runloop mode used to animate the image.
|
||||
@ -174,7 +174,7 @@ typedef UIImage * _Nullable (^asimagenode_modification_block_t)(UIImage *image);
|
||||
* Setting NSDefaultRunLoopMode will cause animation to pause while scrolling (if the ASImageNode is
|
||||
* in a scroll view), which may improve scroll performance in some use cases.
|
||||
*/
|
||||
@property (nonatomic, strong) NSString *animatedImageRunLoopMode;
|
||||
@property (copy) NSString *animatedImageRunLoopMode;
|
||||
|
||||
/**
|
||||
* @abstract Method called when animated image has been set
|
||||
|
||||
@ -41,8 +41,6 @@
|
||||
// TODO: It would be nice to remove this dependency; it's the only subclass using more than +FrameworkSubclasses.h
|
||||
#import <AsyncDisplayKit/ASDisplayNodeInternal.h>
|
||||
|
||||
#include <functional>
|
||||
|
||||
static const CGSize kMinReleaseImageOnBackgroundSize = {20.0, 20.0};
|
||||
|
||||
typedef void (^ASImageNodeDrawParametersBlock)(ASWeakMapEntry *entry);
|
||||
@ -77,14 +75,14 @@ typedef void (^ASImageNodeDrawParametersBlock)(ASWeakMapEntry *entry);
|
||||
*/
|
||||
@interface ASImageNodeContentsKey : NSObject
|
||||
|
||||
@property (nonatomic, strong) UIImage *image;
|
||||
@property (nonatomic) UIImage *image;
|
||||
@property CGSize backingSize;
|
||||
@property CGRect imageDrawRect;
|
||||
@property BOOL isOpaque;
|
||||
@property (nonatomic, strong) UIColor *backgroundColor;
|
||||
@property (nonatomic, copy) ASDisplayNodeContextModifier willDisplayNodeContentWithRenderingContext;
|
||||
@property (nonatomic, copy) ASDisplayNodeContextModifier didDisplayNodeContentWithRenderingContext;
|
||||
@property (nonatomic, copy) asimagenode_modification_block_t imageModificationBlock;
|
||||
@property (nonatomic, copy) UIColor *backgroundColor;
|
||||
@property (nonatomic) ASDisplayNodeContextModifier willDisplayNodeContentWithRenderingContext;
|
||||
@property (nonatomic) ASDisplayNodeContextModifier didDisplayNodeContentWithRenderingContext;
|
||||
@property (nonatomic) asimagenode_modification_block_t imageModificationBlock;
|
||||
|
||||
@end
|
||||
|
||||
@ -150,7 +148,7 @@ typedef void (^ASImageNodeDrawParametersBlock)(ASWeakMapEntry *entry);
|
||||
@private
|
||||
UIImage *_image;
|
||||
ASWeakMapEntry *_weakCacheEntry; // Holds a reference that keeps our contents in cache.
|
||||
|
||||
UIColor *_placeholderColor;
|
||||
|
||||
void (^_displayCompletionBlock)(BOOL canceled);
|
||||
|
||||
@ -227,9 +225,7 @@ typedef void (^ASImageNodeDrawParametersBlock)(ASWeakMapEntry *entry);
|
||||
|
||||
- (CGSize)calculateSizeThatFits:(CGSize)constrainedSize
|
||||
{
|
||||
__instanceLock__.lock();
|
||||
UIImage *image = _image;
|
||||
__instanceLock__.unlock();
|
||||
auto image = ASLockedSelf(_image);
|
||||
|
||||
if (image == nil) {
|
||||
return [super calculateSizeThatFits:constrainedSize];
|
||||
@ -285,21 +281,20 @@ typedef void (^ASImageNodeDrawParametersBlock)(ASWeakMapEntry *entry);
|
||||
|
||||
- (UIImage *)image
|
||||
{
|
||||
ASDN::MutexLocker l(__instanceLock__);
|
||||
return _image;
|
||||
return ASLockedSelf(_image);
|
||||
}
|
||||
|
||||
- (UIImage *)_locked_Image
|
||||
- (UIColor *)placeholderColor
|
||||
{
|
||||
return _image;
|
||||
return ASLockedSelf(_placeholderColor);
|
||||
}
|
||||
|
||||
- (void)setPlaceholderColor:(UIColor *)placeholderColor
|
||||
{
|
||||
_placeholderColor = placeholderColor;
|
||||
|
||||
// prevent placeholders if we don't have a color
|
||||
self.placeholderEnabled = placeholderColor != nil;
|
||||
ASLockScopeSelf();
|
||||
if (ASCompareAssignCopy(_placeholderColor, placeholderColor)) {
|
||||
_placeholderEnabled = (placeholderColor != nil);
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Drawing
|
||||
@ -309,7 +304,7 @@ typedef void (^ASImageNodeDrawParametersBlock)(ASWeakMapEntry *entry);
|
||||
ASLockScopeSelf();
|
||||
|
||||
ASImageNodeDrawParameters *drawParameters = [[ASImageNodeDrawParameters alloc] init];
|
||||
drawParameters->_image = [self _locked_Image];
|
||||
drawParameters->_image = _image;
|
||||
drawParameters->_bounds = [self threadSafeBounds];
|
||||
drawParameters->_opaque = self.opaque;
|
||||
drawParameters->_contentsScale = _contentsScaleForDisplay;
|
||||
|
||||
@ -41,52 +41,54 @@ typedef NS_OPTIONS(NSUInteger, ASMapNodeShowAnnotationsOptions)
|
||||
/**
|
||||
The current options of ASMapNode. This can be set at any time and ASMapNode will animate the change.<br><br>This property may be set from a background thread before the node is loaded, and will automatically be applied to define the behavior of the static snapshot (if .liveMap = NO) or the internal MKMapView (otherwise).<br><br> Changes to the region and camera options will only be animated when when the liveMap mode is enabled, otherwise these options will be applied statically to the new snapshot. <br><br> The options object is used to specify properties even when the liveMap mode is enabled, allowing seamless transitions between the snapshot and liveMap (as well as back to the snapshot).
|
||||
*/
|
||||
@property (nonatomic, strong) MKMapSnapshotOptions *options;
|
||||
@property (nonatomic) MKMapSnapshotOptions *options;
|
||||
|
||||
/** The region is simply the sub-field on the options object. If the objects object is reset,
|
||||
this will in effect be overwritten and become the value of the .region property on that object.
|
||||
Defaults to MKCoordinateRegionForMapRect(MKMapRectWorld).
|
||||
*/
|
||||
@property (nonatomic, assign) MKCoordinateRegion region;
|
||||
@property (nonatomic) MKCoordinateRegion region;
|
||||
|
||||
/**
|
||||
This is the MKMapView that is the live map part of ASMapNode. This will be nil if .liveMap = NO. Note, MKMapView is *not* thread-safe.
|
||||
*/
|
||||
@property (nullable, nonatomic, readonly) MKMapView *mapView;
|
||||
@property (nullable, readonly) MKMapView *mapView;
|
||||
|
||||
/**
|
||||
Set this to YES to turn the snapshot into an interactive MKMapView and vice versa. Defaults to NO. This property may be set on a background thread before the node is loaded, and will automatically be actioned, once the node is loaded.
|
||||
*/
|
||||
@property (nonatomic, assign, getter=isLiveMap) BOOL liveMap;
|
||||
@property (getter=isLiveMap) BOOL liveMap;
|
||||
|
||||
/**
|
||||
@abstract Whether ASMapNode should automatically request a new map snapshot to correspond to the new node size.
|
||||
@default Default value is YES.
|
||||
@discussion If mapSize is set then this will be set to NO, since the size will be the same in all orientations.
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL needsMapReloadOnBoundsChange;
|
||||
@property BOOL needsMapReloadOnBoundsChange;
|
||||
|
||||
/**
|
||||
Set the delegate of the MKMapView. This can be set even before mapView is created and will be set on the map in the case that the liveMap mode is engaged.
|
||||
|
||||
If the live map view has been created, this may only be set on the main thread.
|
||||
*/
|
||||
@property (nonatomic, weak) id <MKMapViewDelegate> mapDelegate;
|
||||
|
||||
/**
|
||||
* @abstract The annotations to display on the map.
|
||||
*/
|
||||
@property (nonatomic, copy) NSArray<id<MKAnnotation>> *annotations;
|
||||
@property (copy) NSArray<id<MKAnnotation>> *annotations;
|
||||
|
||||
/**
|
||||
* @abstract This property specifies how to show the annotations.
|
||||
* @default Default value is ASMapNodeShowAnnotationsIgnored
|
||||
*/
|
||||
@property (nonatomic, assign) ASMapNodeShowAnnotationsOptions showAnnotationsOptions;
|
||||
@property ASMapNodeShowAnnotationsOptions showAnnotationsOptions;
|
||||
|
||||
/**
|
||||
* @abstract The block which should return annotation image for static map based on provided annotation.
|
||||
* @discussion This block is executed on an arbitrary serial queue. If this block is nil, standard pin is used.
|
||||
*/
|
||||
@property (nonatomic, copy, nullable) UIImage * _Nullable (^imageForStaticMapAnnotationBlock)(id<MKAnnotation> annotation, CGPoint *centerOffset);
|
||||
@property (nullable) UIImage * _Nullable (^imageForStaticMapAnnotationBlock)(id<MKAnnotation> annotation, CGPoint *centerOffset);
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@ -177,10 +177,17 @@
|
||||
self.options = options;
|
||||
}
|
||||
|
||||
- (id<MKMapViewDelegate>)mapDelegate
|
||||
{
|
||||
return ASLockedSelf(_mapDelegate);
|
||||
}
|
||||
|
||||
- (void)setMapDelegate:(id<MKMapViewDelegate>)mapDelegate {
|
||||
ASLockScopeSelf();
|
||||
_mapDelegate = mapDelegate;
|
||||
|
||||
if (_mapView) {
|
||||
ASDisplayNodeAssertMainThread();
|
||||
_mapView.delegate = mapDelegate;
|
||||
}
|
||||
}
|
||||
|
||||
@ -78,13 +78,13 @@ typedef NS_ENUM(NSUInteger, ASMultiplexImageNodeErrorCode) {
|
||||
/**
|
||||
* @abstract The delegate, which must conform to the <ASMultiplexImageNodeDelegate> protocol.
|
||||
*/
|
||||
@property (nonatomic, readwrite, weak) id <ASMultiplexImageNodeDelegate> delegate;
|
||||
@property (nonatomic, weak) id <ASMultiplexImageNodeDelegate> delegate;
|
||||
|
||||
/**
|
||||
* @abstract The data source, which must conform to the <ASMultiplexImageNodeDataSource> protocol.
|
||||
* @discussion This value is required for ASMultiplexImageNode to load images.
|
||||
*/
|
||||
@property (nonatomic, readwrite, weak) id <ASMultiplexImageNodeDataSource> dataSource;
|
||||
@property (nonatomic, weak) id <ASMultiplexImageNodeDataSource> dataSource;
|
||||
|
||||
/**
|
||||
* @abstract Whether the receiver should download more than just its highest-quality image. Defaults to NO.
|
||||
@ -93,7 +93,7 @@ typedef NS_ENUM(NSUInteger, ASMultiplexImageNodeErrorCode) {
|
||||
* highest-quality image). If that image is not immediately available or cached, the node can download and display
|
||||
* lesser-quality images. Set `downloadsIntermediateImages` to YES to enable this behaviour.
|
||||
*/
|
||||
@property (nonatomic, readwrite, assign) BOOL downloadsIntermediateImages;
|
||||
@property (nonatomic) BOOL downloadsIntermediateImages;
|
||||
|
||||
/**
|
||||
* @abstract An array of identifiers representing various versions of an image for ASMultiplexImageNode to display.
|
||||
@ -103,7 +103,7 @@ typedef NS_ENUM(NSUInteger, ASMultiplexImageNodeErrorCode) {
|
||||
*
|
||||
* @see <downloadsIntermediateImages> for more information on the image loading process.
|
||||
*/
|
||||
@property (nonatomic, readwrite, copy) NSArray<ASImageIdentifier> *imageIdentifiers;
|
||||
@property (nonatomic, copy) NSArray<ASImageIdentifier> *imageIdentifiers;
|
||||
|
||||
/**
|
||||
* @abstract Notify the receiver SSAA that its data source has new UIImages or NSURLs available for <imageIdentifiers>.
|
||||
@ -129,14 +129,14 @@ typedef NS_ENUM(NSUInteger, ASMultiplexImageNodeErrorCode) {
|
||||
* image will be displayed as the image downloads. Regardless of this properties value, progress renders will
|
||||
* only occur when the node is visible. Defaults to YES.
|
||||
*/
|
||||
@property (nonatomic, assign, readwrite) BOOL shouldRenderProgressImages;
|
||||
@property (nonatomic) BOOL shouldRenderProgressImages;
|
||||
|
||||
/**
|
||||
* @abstract The image manager that this image node should use when requesting images from the Photos framework. If this is `nil` (the default), then `PHImageManager.defaultManager` is used.
|
||||
|
||||
* @see `+[NSURL URLWithAssetLocalIdentifier:targetSize:contentMode:options:]` below.
|
||||
*/
|
||||
@property (nullable, nonatomic, strong) PHImageManager *imageManager API_AVAILABLE(ios(8.0), tvos(10.0));
|
||||
@property (nullable, nonatomic) PHImageManager *imageManager API_AVAILABLE(ios(8.0), tvos(10.0));
|
||||
@end
|
||||
|
||||
|
||||
|
||||
@ -98,10 +98,10 @@ typedef void(^ASMultiplexImageLoadCompletionBlock)(UIImage *image, id imageIdent
|
||||
}
|
||||
|
||||
//! @abstract Read-write redeclaration of property declared in ASMultiplexImageNode.h.
|
||||
@property (nonatomic, readwrite, copy) id loadedImageIdentifier;
|
||||
@property (nonatomic, copy) id loadedImageIdentifier;
|
||||
|
||||
//! @abstract The image identifier that's being loaded by _loadNextImageWithCompletion:.
|
||||
@property (nonatomic, readwrite, copy) id loadingImageIdentifier;
|
||||
@property (nonatomic, copy) id loadingImageIdentifier;
|
||||
|
||||
/**
|
||||
@abstract Returns the next image identifier that should be downloaded.
|
||||
|
||||
@ -54,7 +54,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/**
|
||||
* The delegate, which must conform to the <ASNetworkImageNodeDelegate> protocol.
|
||||
*/
|
||||
@property (nullable, nonatomic, weak, readwrite) id<ASNetworkImageNodeDelegate> delegate;
|
||||
@property (nullable, weak) id<ASNetworkImageNodeDelegate> delegate;
|
||||
|
||||
/**
|
||||
* The image to display.
|
||||
@ -65,14 +65,14 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
* (<defaultImage>) image while loading and the final image after the new image data was downloaded and processed.
|
||||
* If you want to use a placholder image functionality use the defaultImage property instead.
|
||||
*/
|
||||
@property (nullable, nonatomic, strong) UIImage *image;
|
||||
@property (nullable) UIImage *image;
|
||||
|
||||
/**
|
||||
* A placeholder image to display while the URL is loading. This is slightly different than placeholderImage in the
|
||||
* ASDisplayNode superclass as defaultImage will *not* be displayed synchronously. If you wish to have the image
|
||||
* displayed synchronously, use @c placeholderImage.
|
||||
*/
|
||||
@property (nullable, nonatomic, strong, readwrite) UIImage *defaultImage;
|
||||
@property (nullable) UIImage *defaultImage;
|
||||
|
||||
/**
|
||||
* The URL of a new image to download and display.
|
||||
@ -81,7 +81,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
* directly set images to the image property will be cleared out and replaced by the placeholder (<defaultImage>) image
|
||||
* while loading and the final image after the new image data was downloaded and processed.
|
||||
*/
|
||||
@property (nullable, nonatomic, strong, readwrite) NSURL *URL;
|
||||
@property (nullable, copy) NSURL *URL;
|
||||
|
||||
/**
|
||||
* An array of URLs of increasing cost to download.
|
||||
@ -93,7 +93,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
* @deprecated This API has been removed for now due to the increased complexity to the class that it brought.
|
||||
* Please use .URL instead.
|
||||
*/
|
||||
@property (nullable, nonatomic, strong, readwrite) NSArray <NSURL *> *URLs ASDISPLAYNODE_DEPRECATED_MSG("Please use URL instead.");
|
||||
@property (nullable, copy) NSArray <NSURL *> *URLs ASDISPLAYNODE_DEPRECATED_MSG("Please use URL instead.");
|
||||
|
||||
/**
|
||||
* Download and display a new image.
|
||||
@ -110,14 +110,14 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/**
|
||||
* 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 BOOL shouldCacheImage;
|
||||
|
||||
/**
|
||||
* If the downloader implements progressive image rendering and this value is YES progressive renders of the
|
||||
* image will be displayed as the image downloads. Regardless of this properties value, progress renders will
|
||||
* only occur when the node is visible. Defaults to YES.
|
||||
*/
|
||||
@property (nonatomic, assign, readwrite) BOOL shouldRenderProgressImages;
|
||||
@property BOOL shouldRenderProgressImages;
|
||||
|
||||
/**
|
||||
* The image quality of the current image.
|
||||
@ -129,12 +129,12 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
* If the URL is unset, this is 1 if defaultImage or image is set to non-nil.
|
||||
*
|
||||
*/
|
||||
@property (nonatomic, assign, readonly) CGFloat currentImageQuality;
|
||||
@property (readonly) CGFloat currentImageQuality;
|
||||
|
||||
/**
|
||||
* The currentImageQuality (value between 0 and 1) of the last image that completed displaying.
|
||||
*/
|
||||
@property (nonatomic, assign, readonly) CGFloat renderedImageQuality;
|
||||
@property (readonly) CGFloat renderedImageQuality;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@ -204,6 +204,8 @@
|
||||
return;
|
||||
}
|
||||
|
||||
URL = [URL copy];
|
||||
|
||||
ASDisplayNodeAssert(_imageWasSetExternally == NO, @"Setting a URL to an ASNetworkImageNode after setting an image changes its behavior from an ASImageNode to an ASNetworkImageNode. If this is what you want, set the image to nil first.");
|
||||
|
||||
_imageWasSetExternally = NO;
|
||||
@ -312,15 +314,9 @@
|
||||
|
||||
- (void)setShouldRenderProgressImages:(BOOL)shouldRenderProgressImages
|
||||
{
|
||||
{
|
||||
ASLockScopeSelf();
|
||||
if (shouldRenderProgressImages == _shouldRenderProgressImages) {
|
||||
return;
|
||||
}
|
||||
_shouldRenderProgressImages = shouldRenderProgressImages;
|
||||
if (ASLockedSelfCompareAssign(_shouldRenderProgressImages, shouldRenderProgressImages)) {
|
||||
[self _updateProgressImageBlockOnDownloaderIfNeeded];
|
||||
}
|
||||
|
||||
[self _updateProgressImageBlockOnDownloaderIfNeeded];
|
||||
}
|
||||
|
||||
- (BOOL)shouldRenderProgressImages
|
||||
|
||||
@ -26,7 +26,7 @@
|
||||
// Until an ASNodeController can be provided in place of an ASCellNode, some apps may prefer to have
|
||||
// nodes keep their controllers alive (and a weak reference from controller to node)
|
||||
|
||||
@property (nonatomic, assign) BOOL shouldInvertStrongReference;
|
||||
@property (nonatomic) BOOL shouldInvertStrongReference;
|
||||
|
||||
- (void)loadNode;
|
||||
|
||||
|
||||
@ -96,12 +96,12 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/**
|
||||
* The underlying ASCollectionView object.
|
||||
*/
|
||||
@property (nonatomic, readonly) ASCollectionView *view;
|
||||
@property (readonly) ASCollectionView *view;
|
||||
|
||||
/**
|
||||
* Returns the current page index
|
||||
* Returns the current page index. Main thread only.
|
||||
*/
|
||||
@property (nonatomic, assign, readonly) NSInteger currentPageIndex;
|
||||
@property (nonatomic, readonly) NSInteger currentPageIndex;
|
||||
|
||||
/**
|
||||
* Scroll the contents of the receiver to ensure that the page is visible
|
||||
@ -134,7 +134,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
* the pager node will set the property on the view controller to NO and log a warning message. In the future,
|
||||
* the pager node will just log the warning, and you'll need to configure your view controller on your own.
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL allowsAutomaticInsetsAdjustment;
|
||||
@property (nonatomic) BOOL allowsAutomaticInsetsAdjustment;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@ -48,19 +48,19 @@ AS_SUBCLASSING_RESTRICTED
|
||||
|
||||
- (void)enqueue:(ObjectType)object;
|
||||
|
||||
@property (atomic, readonly) BOOL isEmpty;
|
||||
@property (readonly) BOOL isEmpty;
|
||||
|
||||
@property (nonatomic, assign) NSUInteger batchSize; // Default == 1.
|
||||
@property (nonatomic, assign) BOOL ensureExclusiveMembership; // Default == YES. Set-like behavior.
|
||||
@property (nonatomic) NSUInteger batchSize; // Default == 1.
|
||||
@property (nonatomic) BOOL ensureExclusiveMembership; // Default == YES. Set-like behavior.
|
||||
|
||||
@end
|
||||
|
||||
AS_SUBCLASSING_RESTRICTED
|
||||
@interface ASCATransactionQueue : ASAbstractRunLoopQueue
|
||||
|
||||
@property (atomic, readonly) BOOL isEmpty;
|
||||
@property (readonly) BOOL isEmpty;
|
||||
|
||||
@property (atomic, readonly, getter=isEnabled) BOOL enabled;
|
||||
@property (readonly, getter=isEnabled) BOOL enabled;
|
||||
|
||||
/**
|
||||
* The queue to run on main run loop before CATransaction commit.
|
||||
@ -69,7 +69,7 @@ AS_SUBCLASSING_RESTRICTED
|
||||
* to get last chance of updating/coalesce info like interface state.
|
||||
* Each node will only be called once per transaction commit to reflect interface change.
|
||||
*/
|
||||
@property (class, atomic, readonly) ASCATransactionQueue *sharedQueue;
|
||||
@property (class, readonly) ASCATransactionQueue *sharedQueue;
|
||||
+ (ASCATransactionQueue *)sharedQueue NS_RETURNS_RETAINED;
|
||||
|
||||
- (void)enqueue:(id<ASCATransactionQueueObserving>)object;
|
||||
@ -78,7 +78,7 @@ AS_SUBCLASSING_RESTRICTED
|
||||
|
||||
@interface ASDeallocQueue : NSObject
|
||||
|
||||
@property (class, atomic, readonly) ASDeallocQueue *sharedDeallocationQueue;
|
||||
@property (class, readonly) ASDeallocQueue *sharedDeallocationQueue;
|
||||
+ (ASDeallocQueue *)sharedDeallocationQueue NS_RETURNS_RETAINED;
|
||||
|
||||
- (void)drain;
|
||||
|
||||
@ -349,7 +349,7 @@ typedef enum {
|
||||
#endif
|
||||
}
|
||||
|
||||
@property (nonatomic, copy) void (^queueConsumer)(id dequeuedItem, BOOL isQueueDrained);
|
||||
@property (nonatomic) void (^queueConsumer)(id dequeuedItem, BOOL isQueueDrained);
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@ -30,16 +30,16 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/**
|
||||
* @abstract The node's UIScrollView.
|
||||
*/
|
||||
@property (nonatomic, readonly, strong) UIScrollView *view;
|
||||
@property (readonly) UIScrollView *view;
|
||||
|
||||
/**
|
||||
* @abstract When enabled, the size calculated by the node's layout spec is used as
|
||||
* the .contentSize of the scroll view, instead of the bounds size. The bounds is instead
|
||||
* allowed to match the parent's size (whenever it is finite - otherwise, the bounds size
|
||||
* also grows to the full contentSize). It also works with .layoutSpecBlock().
|
||||
* NOTE: Most users of ASScrollView will want to use this, and may be enabled by default later.
|
||||
* NOTE: Most users of ASScrollNode will want to use this, and may be enabled by default later.
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL automaticallyManagesContentSize;
|
||||
@property BOOL automaticallyManagesContentSize;
|
||||
|
||||
/**
|
||||
* @abstract This property controls how the constrainedSize is interpreted when sizing the content.
|
||||
@ -51,7 +51,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
* Vertical & Horizontal: the constrainedSize is interpreted as unbounded in both directions.
|
||||
* @default ASScrollDirectionVerticalDirections
|
||||
*/
|
||||
@property (nonatomic, assign) ASScrollDirection scrollableDirections;
|
||||
@property ASScrollDirection scrollableDirections;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@ -36,34 +36,34 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
- (instancetype)init; // UITableViewStylePlain
|
||||
- (instancetype)initWithStyle:(UITableViewStyle)style NS_DESIGNATED_INITIALIZER;
|
||||
|
||||
@property (strong, nonatomic, readonly) ASTableView *view;
|
||||
@property (readonly) ASTableView *view;
|
||||
|
||||
// These properties can be set without triggering the view to be created, so it's fine to set them in -init.
|
||||
@property (weak, nonatomic) id <ASTableDelegate> delegate;
|
||||
@property (weak, nonatomic) id <ASTableDataSource> dataSource;
|
||||
@property (nullable, weak, nonatomic) id <ASTableDelegate> delegate;
|
||||
@property (nullable, weak, nonatomic) id <ASTableDataSource> dataSource;
|
||||
|
||||
/**
|
||||
* The number of screens left to scroll before the delegate -tableNode:beginBatchFetchingWithContext: is called.
|
||||
*
|
||||
* Defaults to two screenfuls.
|
||||
*/
|
||||
@property (nonatomic, assign) CGFloat leadingScreensForBatching;
|
||||
@property (nonatomic) CGFloat leadingScreensForBatching;
|
||||
|
||||
/*
|
||||
* A Boolean value that determines whether the table will be flipped.
|
||||
* If the value of this property is YES, the first cell node will be at the bottom of the table (as opposed to the top by default). This is useful for chat/messaging apps. The default value is NO.
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL inverted;
|
||||
@property (nonatomic) BOOL inverted;
|
||||
|
||||
/**
|
||||
* The distance that the content view is inset from the table node edges. Defaults to UIEdgeInsetsZero.
|
||||
*/
|
||||
@property (nonatomic, assign) UIEdgeInsets contentInset;
|
||||
@property (nonatomic) UIEdgeInsets contentInset;
|
||||
|
||||
/**
|
||||
* The offset of the content view's origin from the table node's origin. Defaults to CGPointZero.
|
||||
*/
|
||||
@property (nonatomic, assign) CGPoint contentOffset;
|
||||
@property (nonatomic) CGPoint contentOffset;
|
||||
|
||||
/**
|
||||
* Sets the offset from the content node’s origin to the table node’s origin.
|
||||
@ -83,28 +83,28 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
*
|
||||
* default is NO.
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL automaticallyAdjustsContentOffset;
|
||||
@property (nonatomic) BOOL automaticallyAdjustsContentOffset;
|
||||
|
||||
/*
|
||||
* A Boolean value that determines whether users can select a row.
|
||||
* If the value of this property is YES (the default), users can select rows. If you set it to NO, they cannot select rows. Setting this property affects cell selection only when the table view is not in editing mode. If you want to restrict selection of cells in editing mode, use `allowsSelectionDuringEditing`.
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL allowsSelection;
|
||||
@property (nonatomic) BOOL allowsSelection;
|
||||
/*
|
||||
* A Boolean value that determines whether users can select cells while the table view is in editing mode.
|
||||
* If the value of this property is YES, users can select rows during editing. The default value is NO. If you want to restrict selection of cells regardless of mode, use allowsSelection.
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL allowsSelectionDuringEditing;
|
||||
@property (nonatomic) BOOL allowsSelectionDuringEditing;
|
||||
/*
|
||||
* A Boolean value that determines whether users can select more than one row outside of editing mode.
|
||||
* This property controls whether multiple rows can be selected simultaneously outside of editing mode. When the value of this property is YES, each row that is tapped acquires a selected appearance. Tapping the row again removes the selected appearance. If you access indexPathsForSelectedRows, you can get the index paths that identify the selected rows.
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL allowsMultipleSelection;
|
||||
@property (nonatomic) BOOL allowsMultipleSelection;
|
||||
/*
|
||||
* A Boolean value that controls whether users can select more than one cell simultaneously in editing mode.
|
||||
* The default value of this property is NO. If you set it to YES, check marks appear next to selected rows in editing mode. In addition, UITableView does not query for editing styles when it goes into editing mode. If you access indexPathsForSelectedRows, you can get the index paths that identify the selected rows.
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL allowsMultipleSelectionDuringEditing;
|
||||
@property (nonatomic) BOOL allowsMultipleSelectionDuringEditing;
|
||||
|
||||
/**
|
||||
* Tuning parameters for a range type in full mode.
|
||||
@ -444,7 +444,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
*
|
||||
* @discussion This method must be called from the main thread.
|
||||
*/
|
||||
@property (nonatomic, readonly, nullable) NSIndexPath *indexPathForSelectedRow;
|
||||
@property (nullable, nonatomic, copy, readonly) NSIndexPath *indexPathForSelectedRow;
|
||||
|
||||
@property (nonatomic, readonly, nullable) NSArray<NSIndexPath *> *indexPathsForSelectedRows;
|
||||
|
||||
|
||||
@ -36,17 +36,17 @@
|
||||
@interface _ASTablePendingState : NSObject
|
||||
@property (weak, nonatomic) id <ASTableDelegate> delegate;
|
||||
@property (weak, nonatomic) id <ASTableDataSource> dataSource;
|
||||
@property (nonatomic, assign) ASLayoutRangeMode rangeMode;
|
||||
@property (nonatomic, assign) BOOL allowsSelection;
|
||||
@property (nonatomic, assign) BOOL allowsSelectionDuringEditing;
|
||||
@property (nonatomic, assign) BOOL allowsMultipleSelection;
|
||||
@property (nonatomic, assign) BOOL allowsMultipleSelectionDuringEditing;
|
||||
@property (nonatomic, assign) BOOL inverted;
|
||||
@property (nonatomic, assign) CGFloat leadingScreensForBatching;
|
||||
@property (nonatomic, assign) UIEdgeInsets contentInset;
|
||||
@property (nonatomic, assign) CGPoint contentOffset;
|
||||
@property (nonatomic, assign) BOOL animatesContentOffset;
|
||||
@property (nonatomic, assign) BOOL automaticallyAdjustsContentOffset;
|
||||
@property (nonatomic) ASLayoutRangeMode rangeMode;
|
||||
@property (nonatomic) BOOL allowsSelection;
|
||||
@property (nonatomic) BOOL allowsSelectionDuringEditing;
|
||||
@property (nonatomic) BOOL allowsMultipleSelection;
|
||||
@property (nonatomic) BOOL allowsMultipleSelectionDuringEditing;
|
||||
@property (nonatomic) BOOL inverted;
|
||||
@property (nonatomic) CGFloat leadingScreensForBatching;
|
||||
@property (nonatomic) UIEdgeInsets contentInset;
|
||||
@property (nonatomic) CGPoint contentOffset;
|
||||
@property (nonatomic) BOOL animatesContentOffset;
|
||||
@property (nonatomic) BOOL automaticallyAdjustsContentOffset;
|
||||
@end
|
||||
|
||||
@implementation _ASTablePendingState
|
||||
@ -79,7 +79,7 @@
|
||||
id<ASBatchFetchingDelegate> _batchFetchingDelegate;
|
||||
}
|
||||
|
||||
@property (nonatomic, strong) _ASTablePendingState *pendingState;
|
||||
@property (nonatomic) _ASTablePendingState *pendingState;
|
||||
@end
|
||||
|
||||
@implementation ASTableNode
|
||||
|
||||
@ -65,17 +65,17 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
*
|
||||
* Defaults to two screenfuls.
|
||||
*/
|
||||
@property (nonatomic, assign) CGFloat leadingScreensForBatching ASDISPLAYNODE_DEPRECATED_MSG("Use ASTableNode property instead.");
|
||||
@property (nonatomic) CGFloat leadingScreensForBatching ASDISPLAYNODE_DEPRECATED_MSG("Use ASTableNode property instead.");
|
||||
|
||||
/**
|
||||
* The distance that the content view is inset from the table view edges. Defaults to UIEdgeInsetsZero.
|
||||
*/
|
||||
@property (nonatomic, assign) UIEdgeInsets contentInset ASDISPLAYNODE_DEPRECATED_MSG("Use ASTableNode property instead");
|
||||
@property (nonatomic) UIEdgeInsets contentInset ASDISPLAYNODE_DEPRECATED_MSG("Use ASTableNode property instead");
|
||||
|
||||
/**
|
||||
* The offset of the content view's origin from the table node's origin. Defaults to CGPointZero.
|
||||
*/
|
||||
@property (nonatomic, assign) CGPoint contentOffset ASDISPLAYNODE_DEPRECATED_MSG("Use ASTableNode property instead.");
|
||||
@property (nonatomic) CGPoint contentOffset ASDISPLAYNODE_DEPRECATED_MSG("Use ASTableNode property instead.");
|
||||
|
||||
/**
|
||||
* YES to automatically adjust the contentOffset when cells are inserted or deleted above
|
||||
@ -91,7 +91,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/*
|
||||
* A Boolean value that determines whether the nodes that the data source renders will be flipped.
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL inverted ASDISPLAYNODE_DEPRECATED_MSG("Use ASTableNode property instead.");
|
||||
@property (nonatomic) BOOL inverted ASDISPLAYNODE_DEPRECATED_MSG("Use ASTableNode property instead.");
|
||||
|
||||
@property (nonatomic, readonly, nullable) NSIndexPath *indexPathForSelectedRow ASDISPLAYNODE_DEPRECATED_MSG("Use ASTableNode property instead.");
|
||||
|
||||
|
||||
@ -82,8 +82,8 @@ static NSString * const kCellReuseIdentifier = @"_ASTableViewCell";
|
||||
|
||||
@interface _ASTableViewCell : UITableViewCell
|
||||
@property (nonatomic, weak) id<_ASTableViewCellDelegate> delegate;
|
||||
@property (nonatomic, strong, readonly) ASCellNode *node;
|
||||
@property (nonatomic, strong) ASCollectionElement *element;
|
||||
@property (nonatomic, readonly) ASCellNode *node;
|
||||
@property (nonatomic) ASCollectionElement *element;
|
||||
@end
|
||||
|
||||
@implementation _ASTableViewCell
|
||||
@ -279,7 +279,7 @@ static NSString * const kCellReuseIdentifier = @"_ASTableViewCell";
|
||||
} _asyncDataSourceFlags;
|
||||
}
|
||||
|
||||
@property (nonatomic, strong, readwrite) ASDataController *dataController;
|
||||
@property (nonatomic) ASDataController *dataController;
|
||||
|
||||
@property (nonatomic, weak) ASTableNode *tableNode;
|
||||
|
||||
|
||||
@ -24,9 +24,9 @@
|
||||
|
||||
@interface ASTableView (Internal)
|
||||
|
||||
@property (nonatomic, strong, readonly) ASDataController *dataController;
|
||||
@property (nonatomic, weak, readwrite) ASTableNode *tableNode;
|
||||
@property (nonatomic, strong, readonly) ASRangeController *rangeController;
|
||||
@property (nonatomic, readonly) ASDataController *dataController;
|
||||
@property (nonatomic, weak) ASTableNode *tableNode;
|
||||
@property (nonatomic, readonly) ASRangeController *rangeController;
|
||||
|
||||
/**
|
||||
* Initializer.
|
||||
|
||||
@ -36,12 +36,12 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
This property can be useful for handling text which does not fit within the view by default. An example: like UILabel,
|
||||
ASTextNode will clip the left and right of the string "judar" if it's rendered in an italicised font.
|
||||
*/
|
||||
@property (nonatomic, assign) UIEdgeInsets textContainerInset;
|
||||
@property (nonatomic) UIEdgeInsets textContainerInset;
|
||||
|
||||
/**
|
||||
* Returns YES if this node is using the experimental implementation. NO otherwise. Will not change.
|
||||
*/
|
||||
@property (atomic, readonly) BOOL usingExperiment;
|
||||
@property (readonly) BOOL usingExperiment;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@ -32,7 +32,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@discussion Defaults to nil, no text is shown.
|
||||
For inline image attachments, add an attribute of key NSAttachmentAttributeName, with a value of an NSTextAttachment.
|
||||
*/
|
||||
@property (nullable, nonatomic, copy) NSAttributedString *attributedText;
|
||||
@property (nullable, copy) NSAttributedString *attributedText;
|
||||
|
||||
#pragma mark - Truncation
|
||||
|
||||
@ -40,37 +40,37 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@abstract The attributedText to use when the text must be truncated.
|
||||
@discussion Defaults to a localized ellipsis character.
|
||||
*/
|
||||
@property (nullable, nonatomic, copy) NSAttributedString *truncationAttributedText;
|
||||
@property (nullable, copy) NSAttributedString *truncationAttributedText;
|
||||
|
||||
/**
|
||||
@summary The second attributed string appended for truncation.
|
||||
@discussion This string will be highlighted on touches.
|
||||
@default nil
|
||||
*/
|
||||
@property (nullable, nonatomic, copy) NSAttributedString *additionalTruncationMessage;
|
||||
@property (nullable, copy) NSAttributedString *additionalTruncationMessage;
|
||||
|
||||
/**
|
||||
@abstract Determines how the text is truncated to fit within the receiver's maximum size.
|
||||
@discussion Defaults to NSLineBreakByWordWrapping.
|
||||
@note Setting a truncationMode in attributedString will override the truncation mode set here.
|
||||
*/
|
||||
@property (nonatomic, assign) NSLineBreakMode truncationMode;
|
||||
@property NSLineBreakMode truncationMode;
|
||||
|
||||
/**
|
||||
@abstract If the text node is truncated. Text must have been sized first.
|
||||
*/
|
||||
@property (nonatomic, readonly, assign, getter=isTruncated) BOOL truncated;
|
||||
@property (readonly, getter=isTruncated) BOOL truncated;
|
||||
|
||||
/**
|
||||
@abstract The maximum number of lines to render of the text before truncation.
|
||||
@default 0 (No limit)
|
||||
*/
|
||||
@property (nonatomic, assign) NSUInteger maximumNumberOfLines;
|
||||
@property NSUInteger maximumNumberOfLines;
|
||||
|
||||
/**
|
||||
@abstract The number of lines in the text. Text must have been sized first.
|
||||
*/
|
||||
@property (nonatomic, readonly, assign) NSUInteger lineCount;
|
||||
@property (readonly) NSUInteger lineCount;
|
||||
|
||||
/**
|
||||
* An array of path objects representing the regions where text should not be displayed.
|
||||
@ -80,7 +80,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
* the text node's bounds. You can use this property to have text wrap around images,
|
||||
* shapes or other text like a fancy magazine.
|
||||
*/
|
||||
@property (nullable, nonatomic, strong) NSArray<UIBezierPath *> *exclusionPaths;
|
||||
@property (nullable, copy) NSArray<UIBezierPath *> *exclusionPaths;
|
||||
|
||||
#pragma mark - Placeholders
|
||||
|
||||
@ -91,27 +91,27 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
* following the true shape of the text's wrapping. This visually mirrors the overall
|
||||
* shape and weight of paragraphs, making the appearance of the finished text less jarring.
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL placeholderEnabled;
|
||||
@property BOOL placeholderEnabled;
|
||||
|
||||
/**
|
||||
@abstract The placeholder color.
|
||||
*/
|
||||
@property (nullable, nonatomic, strong) UIColor *placeholderColor;
|
||||
@property (nullable, copy) UIColor *placeholderColor;
|
||||
|
||||
/**
|
||||
@abstract Inset each line of the placeholder.
|
||||
*/
|
||||
@property (nonatomic, assign) UIEdgeInsets placeholderInsets;
|
||||
@property UIEdgeInsets placeholderInsets;
|
||||
|
||||
#pragma mark - Shadow
|
||||
|
||||
/**
|
||||
@abstract When you set these ASDisplayNode properties, they are composited into the bitmap instead of being applied by CA.
|
||||
|
||||
@property (nonatomic, assign) CGColorRef shadowColor;
|
||||
@property (nonatomic, assign) CGFloat shadowOpacity;
|
||||
@property (nonatomic, assign) CGSize shadowOffset;
|
||||
@property (nonatomic, assign) CGFloat shadowRadius;
|
||||
@property (nonatomic) CGColorRef shadowColor;
|
||||
@property (nonatomic) CGFloat shadowOpacity;
|
||||
@property (nonatomic) CGSize shadowOffset;
|
||||
@property (nonatomic) CGFloat shadowRadius;
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -120,7 +120,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
UIEdgeInsetsRect(boundingRectForText, shadowPadding)
|
||||
will return a CGRect large enough to fit both the text and the appropriate shadow padding.
|
||||
*/
|
||||
@property (nonatomic, readonly, assign) UIEdgeInsets shadowPadding;
|
||||
@property (readonly) UIEdgeInsets shadowPadding;
|
||||
|
||||
#pragma mark - Positioning
|
||||
|
||||
@ -167,7 +167,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/**
|
||||
@abstract The set of attribute names to consider links. Defaults to NSLinkAttributeName.
|
||||
*/
|
||||
@property (nonatomic, copy) NSArray<NSString *> *linkAttributeNames;
|
||||
@property (copy) NSArray<NSString *> *linkAttributeNames;
|
||||
|
||||
/**
|
||||
@abstract Indicates whether the receiver has an entity at a given point.
|
||||
@ -181,12 +181,12 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/**
|
||||
@abstract The style to use when highlighting text.
|
||||
*/
|
||||
@property (nonatomic, assign) ASTextNodeHighlightStyle highlightStyle;
|
||||
@property ASTextNodeHighlightStyle highlightStyle;
|
||||
|
||||
/**
|
||||
@abstract The range of text highlighted by the receiver. Changes to this property are not animated by default.
|
||||
*/
|
||||
@property (nonatomic, assign) NSRange highlightRange;
|
||||
@property NSRange highlightRange;
|
||||
|
||||
/**
|
||||
@abstract Set the range of text to highlight, with optional animation.
|
||||
@ -203,25 +203,25 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
textNode:longPressedLinkAttribute:value:atPoint:textRange: in order for
|
||||
the long press gesture recognizer to be installed.
|
||||
*/
|
||||
@property (nonatomic, weak) id<ASTextNodeDelegate> delegate;
|
||||
@property (nullable, weak) id<ASTextNodeDelegate> delegate;
|
||||
|
||||
/**
|
||||
@abstract If YES and a long press is recognized, touches are cancelled. Default is NO
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL longPressCancelsTouches;
|
||||
@property (nonatomic) BOOL longPressCancelsTouches;
|
||||
|
||||
/**
|
||||
@abstract if YES will not intercept touches for non-link areas of the text. Default is NO.
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL passthroughNonlinkTouches;
|
||||
@property (nonatomic) BOOL passthroughNonlinkTouches;
|
||||
|
||||
@end
|
||||
|
||||
@interface ASTextNode (Unavailable)
|
||||
|
||||
- (instancetype)initWithLayerBlock:(ASDisplayNodeLayerBlock)viewBlock didLoadBlock:(nullable ASDisplayNodeDidLoadBlock)didLoadBlock __unavailable;
|
||||
- (instancetype)initWithLayerBlock:(ASDisplayNodeLayerBlock)viewBlock didLoadBlock:(nullable ASDisplayNodeDidLoadBlock)didLoadBlock NS_UNAVAILABLE;
|
||||
|
||||
- (instancetype)initWithViewBlock:(ASDisplayNodeViewBlock)viewBlock didLoadBlock:(nullable ASDisplayNodeDidLoadBlock)didLoadBlock __unavailable;
|
||||
- (instancetype)initWithViewBlock:(ASDisplayNodeViewBlock)viewBlock didLoadBlock:(nullable ASDisplayNodeDidLoadBlock)didLoadBlock NS_UNAVAILABLE;
|
||||
|
||||
@end
|
||||
|
||||
@ -236,7 +236,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@see attributedText
|
||||
*/
|
||||
@property (nullable, nonatomic, copy) NSAttributedString *attributedString ASDISPLAYNODE_DEPRECATED_MSG("Use .attributedText instead.");
|
||||
@property (nullable, copy) NSAttributedString *attributedString ASDISPLAYNODE_DEPRECATED_MSG("Use .attributedText instead.");
|
||||
|
||||
|
||||
/**
|
||||
@ -245,7 +245,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@see truncationAttributedText
|
||||
*/
|
||||
@property (nullable, nonatomic, copy) NSAttributedString *truncationAttributedString ASDISPLAYNODE_DEPRECATED_MSG("Use .truncationAttributedText instead.");
|
||||
@property (nullable, copy) NSAttributedString *truncationAttributedString ASDISPLAYNODE_DEPRECATED_MSG("Use .truncationAttributedText instead.");
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@ -61,8 +61,8 @@ static NSString *ASTextNodeTruncationTokenAttributeName = @"ASTextNodeTruncation
|
||||
#pragma mark - ASTextKitRenderer
|
||||
|
||||
@interface ASTextNodeRendererKey : NSObject
|
||||
@property (assign, nonatomic) ASTextKitAttributes attributes;
|
||||
@property (assign, nonatomic) CGSize constrainedSize;
|
||||
@property (nonatomic) ASTextKitAttributes attributes;
|
||||
@property (nonatomic) CGSize constrainedSize;
|
||||
@end
|
||||
|
||||
@implementation ASTextNodeRendererKey {
|
||||
@ -181,6 +181,7 @@ static ASTextKitRenderer *rendererForAttributes(ASTextKitAttributes attributes,
|
||||
CGSize _shadowOffset;
|
||||
CGColorRef _shadowColor;
|
||||
UIColor *_cachedShadowUIColor;
|
||||
UIColor *_placeholderColor;
|
||||
CGFloat _shadowOpacity;
|
||||
CGFloat _shadowRadius;
|
||||
|
||||
@ -884,6 +885,11 @@ static CGRect ASTextNodeAdjustRenderRectForShadowPadding(CGRect rendererRect, UI
|
||||
|
||||
#pragma mark - Placeholders
|
||||
|
||||
- (UIColor *)placeholderColor
|
||||
{
|
||||
return ASLockedSelf(_placeholderColor);
|
||||
}
|
||||
|
||||
- (void)setPlaceholderColor:(UIColor *)placeholderColor
|
||||
{
|
||||
if (ASLockedSelfCompareAssignCopy(_placeholderColor, placeholderColor)) {
|
||||
|
||||
@ -26,7 +26,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@discussion Defaults to nil, no text is shown.
|
||||
For inline image attachments, add an attribute of key NSAttachmentAttributeName, with a value of an NSTextAttachment.
|
||||
*/
|
||||
@property (nullable, nonatomic, copy) NSAttributedString *attributedText;
|
||||
@property (nullable, copy) NSAttributedString *attributedText;
|
||||
|
||||
#pragma mark - Truncation
|
||||
|
||||
@ -34,37 +34,37 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@abstract The attributedText to use when the text must be truncated.
|
||||
@discussion Defaults to a localized ellipsis character.
|
||||
*/
|
||||
@property (nullable, nonatomic, copy) NSAttributedString *truncationAttributedText;
|
||||
@property (nullable, copy) NSAttributedString *truncationAttributedText;
|
||||
|
||||
/**
|
||||
@summary The second attributed string appended for truncation.
|
||||
@discussion This string will be highlighted on touches.
|
||||
@default nil
|
||||
*/
|
||||
@property (nullable, nonatomic, copy) NSAttributedString *additionalTruncationMessage;
|
||||
@property (nullable, copy) NSAttributedString *additionalTruncationMessage;
|
||||
|
||||
/**
|
||||
@abstract Determines how the text is truncated to fit within the receiver's maximum size.
|
||||
@discussion Defaults to NSLineBreakByWordWrapping.
|
||||
@note Setting a truncationMode in attributedString will override the truncation mode set here.
|
||||
*/
|
||||
@property (nonatomic, assign) NSLineBreakMode truncationMode;
|
||||
@property NSLineBreakMode truncationMode;
|
||||
|
||||
/**
|
||||
@abstract If the text node is truncated. Text must have been sized first.
|
||||
*/
|
||||
@property (nonatomic, readonly, assign, getter=isTruncated) BOOL truncated;
|
||||
@property (readonly, getter=isTruncated) BOOL truncated;
|
||||
|
||||
/**
|
||||
@abstract The maximum number of lines to render of the text before truncation.
|
||||
@default 0 (No limit)
|
||||
*/
|
||||
@property (nonatomic, assign) NSUInteger maximumNumberOfLines;
|
||||
@property NSUInteger maximumNumberOfLines;
|
||||
|
||||
/**
|
||||
@abstract The number of lines in the text. Text must have been sized first.
|
||||
*/
|
||||
@property (nonatomic, readonly, assign) NSUInteger lineCount;
|
||||
@property (readonly) NSUInteger lineCount;
|
||||
|
||||
/**
|
||||
* An array of path objects representing the regions where text should not be displayed.
|
||||
@ -74,7 +74,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
* the text node's bounds. You can use this property to have text wrap around images,
|
||||
* shapes or other text like a fancy magazine.
|
||||
*/
|
||||
@property (nullable, nonatomic, strong) NSArray<UIBezierPath *> *exclusionPaths;
|
||||
@property (nullable, copy) NSArray<UIBezierPath *> *exclusionPaths;
|
||||
|
||||
#pragma mark - Placeholders
|
||||
|
||||
@ -85,27 +85,27 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
* following the true shape of the text's wrapping. This visually mirrors the overall
|
||||
* shape and weight of paragraphs, making the appearance of the finished text less jarring.
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL placeholderEnabled;
|
||||
@property BOOL placeholderEnabled;
|
||||
|
||||
/**
|
||||
@abstract The placeholder color.
|
||||
*/
|
||||
@property (nullable, nonatomic, strong) UIColor *placeholderColor;
|
||||
@property (nullable, copy) UIColor *placeholderColor;
|
||||
|
||||
/**
|
||||
@abstract Inset each line of the placeholder.
|
||||
*/
|
||||
@property (nonatomic, assign) UIEdgeInsets placeholderInsets;
|
||||
@property UIEdgeInsets placeholderInsets;
|
||||
|
||||
#pragma mark - Shadow
|
||||
|
||||
/**
|
||||
@abstract When you set these ASDisplayNode properties, they are composited into the bitmap instead of being applied by CA.
|
||||
|
||||
@property (nonatomic, assign) CGColorRef shadowColor;
|
||||
@property (nonatomic, assign) CGFloat shadowOpacity;
|
||||
@property (nonatomic, assign) CGSize shadowOffset;
|
||||
@property (nonatomic, assign) CGFloat shadowRadius;
|
||||
@property (nonatomic) CGColorRef shadowColor;
|
||||
@property (nonatomic) CGFloat shadowOpacity;
|
||||
@property (nonatomic) CGSize shadowOffset;
|
||||
@property (nonatomic) CGFloat shadowRadius;
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -114,7 +114,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
UIEdgeInsetsRect(boundingRectForText, shadowPadding)
|
||||
will return a CGRect large enough to fit both the text and the appropriate shadow padding.
|
||||
*/
|
||||
@property (nonatomic, readonly, assign) UIEdgeInsets shadowPadding;
|
||||
@property (nonatomic, readonly) UIEdgeInsets shadowPadding;
|
||||
|
||||
#pragma mark - Positioning
|
||||
|
||||
@ -175,12 +175,12 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/**
|
||||
@abstract The style to use when highlighting text.
|
||||
*/
|
||||
@property (nonatomic, assign) ASTextNodeHighlightStyle highlightStyle;
|
||||
@property (nonatomic) ASTextNodeHighlightStyle highlightStyle;
|
||||
|
||||
/**
|
||||
@abstract The range of text highlighted by the receiver. Changes to this property are not animated by default.
|
||||
*/
|
||||
@property (nonatomic, assign) NSRange highlightRange;
|
||||
@property (nonatomic) NSRange highlightRange;
|
||||
|
||||
/**
|
||||
@abstract Set the range of text to highlight, with optional animation.
|
||||
@ -197,17 +197,17 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
textNode:longPressedLinkAttribute:value:atPoint:textRange: in order for
|
||||
the long press gesture recognizer to be installed.
|
||||
*/
|
||||
@property (atomic, weak) id<ASTextNodeDelegate> delegate;
|
||||
@property (weak) id<ASTextNodeDelegate> delegate;
|
||||
|
||||
/**
|
||||
@abstract If YES and a long press is recognized, touches are cancelled. Default is NO
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL longPressCancelsTouches;
|
||||
@property (nonatomic) BOOL longPressCancelsTouches;
|
||||
|
||||
/**
|
||||
@abstract if YES will not intercept touches for non-link areas of the text. Default is NO.
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL passthroughNonlinkTouches;
|
||||
@property (nonatomic) BOOL passthroughNonlinkTouches;
|
||||
|
||||
+ (void)enableDebugging;
|
||||
|
||||
@ -215,9 +215,9 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface ASTextNode2 (Unavailable)
|
||||
|
||||
- (instancetype)initWithLayerBlock:(ASDisplayNodeLayerBlock)viewBlock didLoadBlock:(nullable ASDisplayNodeDidLoadBlock)didLoadBlock __unavailable;
|
||||
- (instancetype)initWithLayerBlock:(ASDisplayNodeLayerBlock)viewBlock didLoadBlock:(nullable ASDisplayNodeDidLoadBlock)didLoadBlock NS_UNAVAILABLE;
|
||||
|
||||
- (instancetype)initWithViewBlock:(ASDisplayNodeViewBlock)viewBlock didLoadBlock:(nullable ASDisplayNodeDidLoadBlock)didLoadBlock __unavailable;
|
||||
- (instancetype)initWithViewBlock:(ASDisplayNodeViewBlock)viewBlock didLoadBlock:(nullable ASDisplayNodeDidLoadBlock)didLoadBlock NS_UNAVAILABLE;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@ -75,14 +75,18 @@ static NSString *ASTextNodeTruncationTokenAttributeName = @"ASTextNodeTruncation
|
||||
CGFloat _shadowRadius;
|
||||
|
||||
NSAttributedString *_attributedText;
|
||||
NSAttributedString *_truncationAttributedText;
|
||||
NSAttributedString *_additionalTruncationMessage;
|
||||
NSAttributedString *_composedTruncationText;
|
||||
NSArray<NSNumber *> *_pointSizeScaleFactors;
|
||||
NSLineBreakMode _truncationMode;
|
||||
|
||||
NSString *_highlightedLinkAttributeName;
|
||||
id _highlightedLinkAttributeValue;
|
||||
ASTextNodeHighlightStyle _highlightStyle;
|
||||
NSRange _highlightRange;
|
||||
ASHighlightOverlayLayer *_activeHighlightLayer;
|
||||
UIColor *_placeholderColor;
|
||||
|
||||
UILongPressGestureRecognizer *_longPressGestureRecognizer;
|
||||
}
|
||||
@ -691,14 +695,17 @@ static NSArray *DefaultLinkAttributeNames = @[ NSLinkAttributeName ];
|
||||
|
||||
#pragma mark - Placeholders
|
||||
|
||||
- (UIColor *)placeholderColor
|
||||
{
|
||||
return ASLockedSelf(_placeholderColor);
|
||||
}
|
||||
|
||||
- (void)setPlaceholderColor:(UIColor *)placeholderColor
|
||||
{
|
||||
ASLockScopeSelf();
|
||||
|
||||
_placeholderColor = placeholderColor;
|
||||
|
||||
// prevent placeholders if we don't have a color
|
||||
self.placeholderEnabled = placeholderColor != nil;
|
||||
if (ASCompareAssignCopy(_placeholderColor, placeholderColor)) {
|
||||
self.placeholderEnabled = CGColorGetAlpha(placeholderColor.CGColor) > 0;
|
||||
}
|
||||
}
|
||||
|
||||
- (UIImage *)placeholderImage
|
||||
@ -966,6 +973,11 @@ static NSAttributedString *DefaultTruncationAttributedString()
|
||||
}
|
||||
}
|
||||
|
||||
- (NSAttributedString *)truncationAttributedText
|
||||
{
|
||||
return ASLockedSelf(_truncationAttributedText);
|
||||
}
|
||||
|
||||
- (void)setTruncationAttributedText:(NSAttributedString *)truncationAttributedText
|
||||
{
|
||||
ASLockScopeSelf();
|
||||
@ -974,6 +986,11 @@ static NSAttributedString *DefaultTruncationAttributedString()
|
||||
}
|
||||
}
|
||||
|
||||
- (NSAttributedString *)additionalTruncationMessage
|
||||
{
|
||||
return ASLockedSelf(_additionalTruncationMessage);
|
||||
}
|
||||
|
||||
- (void)setAdditionalTruncationMessage:(NSAttributedString *)additionalTruncationMessage
|
||||
{
|
||||
ASLockScopeSelf();
|
||||
@ -982,6 +999,11 @@ static NSAttributedString *DefaultTruncationAttributedString()
|
||||
}
|
||||
}
|
||||
|
||||
- (NSLineBreakMode)truncationMode
|
||||
{
|
||||
return ASLockedSelf(_truncationMode);
|
||||
}
|
||||
|
||||
- (void)setTruncationMode:(NSLineBreakMode)truncationMode
|
||||
{
|
||||
ASLockScopeSelf();
|
||||
|
||||
@ -46,39 +46,46 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
- (BOOL)isPlaying;
|
||||
- (void)resetToPlaceholder;
|
||||
|
||||
@property (nullable, nonatomic, strong, readwrite) AVAsset *asset;
|
||||
// TODO: copy
|
||||
@property (nullable) AVAsset *asset;
|
||||
|
||||
/**
|
||||
** @abstract The URL with which the asset was initialized.
|
||||
** @discussion Setting the URL will override the current asset with a newly created AVURLAsset created from the given URL, and AVAsset *asset will point to that newly created AVURLAsset. Please don't set both assetURL and asset.
|
||||
** @return Current URL the asset was initialized or nil if no URL was given.
|
||||
**/
|
||||
@property (nullable, nonatomic, strong, readwrite) NSURL *assetURL;
|
||||
@property (nullable, nonatomic, strong, readwrite) AVVideoComposition *videoComposition;
|
||||
@property (nullable, nonatomic, strong, readwrite) AVAudioMix *audioMix;
|
||||
@property (nullable, copy) NSURL *assetURL;
|
||||
|
||||
@property (nullable, nonatomic, strong, readonly) AVPlayer *player;
|
||||
@property (nullable, nonatomic, strong, readonly) AVPlayerLayer *playerLayer;
|
||||
@property (nullable, nonatomic, strong, readonly) AVPlayerItem *currentItem;
|
||||
// TODO: copy both of these.
|
||||
@property (nullable) AVVideoComposition *videoComposition;
|
||||
@property (nullable) AVAudioMix *audioMix;
|
||||
|
||||
@property (nullable, readonly) AVPlayer *player;
|
||||
|
||||
// TODO: copy
|
||||
@property (nullable, readonly) AVPlayerItem *currentItem;
|
||||
|
||||
@property (nullable, nonatomic, readonly) AVPlayerLayer *playerLayer;
|
||||
|
||||
|
||||
/**
|
||||
* When shouldAutoplay is set to true, a video node will play when it has both loaded and entered the "visible" interfaceState.
|
||||
* If it leaves the visible interfaceState it will pause but will resume once it has returned.
|
||||
*/
|
||||
@property (nonatomic, assign, readwrite) BOOL shouldAutoplay;
|
||||
@property (nonatomic, assign, readwrite) BOOL shouldAutorepeat;
|
||||
@property BOOL shouldAutoplay;
|
||||
@property BOOL shouldAutorepeat;
|
||||
|
||||
@property (nonatomic, assign, readwrite) BOOL muted;
|
||||
@property (nonatomic, assign, readwrite) BOOL shouldAggressivelyRecoverFromStall;
|
||||
@property BOOL muted;
|
||||
@property BOOL shouldAggressivelyRecoverFromStall;
|
||||
|
||||
@property (nonatomic, assign, readonly) ASVideoNodePlayerState playerState;
|
||||
@property (readonly) ASVideoNodePlayerState playerState;
|
||||
//! Defaults to 1000
|
||||
@property (nonatomic, assign) int32_t periodicTimeObserverTimescale;
|
||||
@property int32_t periodicTimeObserverTimescale;
|
||||
|
||||
//! Defaults to AVLayerVideoGravityResizeAspect
|
||||
@property (nonatomic, copy) NSString *gravity;
|
||||
@property (null_resettable, copy) NSString *gravity;
|
||||
|
||||
@property (nullable, nonatomic, weak, readwrite) id<ASVideoNodeDelegate, ASNetworkImageNodeDelegate> delegate;
|
||||
@property (nullable, weak) id<ASVideoNodeDelegate, ASNetworkImageNodeDelegate> delegate;
|
||||
|
||||
@end
|
||||
|
||||
@ -160,7 +167,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface ASVideoNode (Unavailable)
|
||||
|
||||
- (instancetype)initWithViewBlock:(ASDisplayNodeViewBlock)viewBlock didLoadBlock:(nullable ASDisplayNodeDidLoadBlock)didLoadBlock __unavailable;
|
||||
- (instancetype)initWithViewBlock:(ASDisplayNodeViewBlock)viewBlock didLoadBlock:(nullable ASDisplayNodeDidLoadBlock)didLoadBlock NS_UNAVAILABLE;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@ -618,6 +618,14 @@ static NSString * const kRate = @"rate";
|
||||
- (void)setGravity:(NSString *)gravity
|
||||
{
|
||||
ASLockScopeSelf();
|
||||
if (!gravity) {
|
||||
gravity = AVLayerVideoGravityResizeAspect;
|
||||
}
|
||||
|
||||
if (!ASCompareAssignObjects(_gravity, gravity)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (_playerNode.isNodeLoaded) {
|
||||
((AVPlayerLayer *)_playerNode.layer).videoGravity = gravity;
|
||||
}
|
||||
|
||||
@ -40,35 +40,35 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@property (nullable, nonatomic, weak) id<ASVideoPlayerNodeDelegate> delegate;
|
||||
|
||||
@property (nonatomic, assign, readonly) CMTime duration;
|
||||
@property (nonatomic, readonly) CMTime duration;
|
||||
|
||||
@property (nonatomic, assign) BOOL controlsDisabled;
|
||||
@property (nonatomic) BOOL controlsDisabled;
|
||||
|
||||
#pragma mark - ASVideoNode property proxy
|
||||
/**
|
||||
* When shouldAutoplay is set to true, a video node will play when it has both loaded and entered the "visible" interfaceState.
|
||||
* If it leaves the visible interfaceState it will pause but will resume once it has returned.
|
||||
*/
|
||||
@property (nonatomic, assign, readwrite) BOOL shouldAutoPlay;
|
||||
@property (nonatomic, assign, readwrite) BOOL shouldAutoRepeat;
|
||||
@property (nonatomic, assign, readwrite) BOOL muted;
|
||||
@property (nonatomic, assign, readonly) ASVideoNodePlayerState playerState;
|
||||
@property (nonatomic, assign, readwrite) BOOL shouldAggressivelyRecoverFromStall;
|
||||
@property (nullable, nonatomic, strong, readwrite) NSURL *placeholderImageURL;
|
||||
@property (nonatomic) BOOL shouldAutoPlay;
|
||||
@property (nonatomic) BOOL shouldAutoRepeat;
|
||||
@property (nonatomic) BOOL muted;
|
||||
@property (nonatomic, readonly) ASVideoNodePlayerState playerState;
|
||||
@property (nonatomic) BOOL shouldAggressivelyRecoverFromStall;
|
||||
@property (nullable, nonatomic) NSURL *placeholderImageURL;
|
||||
|
||||
@property (nullable, nonatomic, strong, readwrite) AVAsset *asset;
|
||||
@property (nullable, nonatomic) AVAsset *asset;
|
||||
/**
|
||||
** @abstract The URL with which the asset was initialized.
|
||||
** @discussion Setting the URL will override the current asset with a newly created AVURLAsset created from the given URL, and AVAsset *asset will point to that newly created AVURLAsset. Please don't set both assetURL and asset.
|
||||
** @return Current URL the asset was initialized or nil if no URL was given.
|
||||
**/
|
||||
@property (nullable, nonatomic, strong, readwrite) NSURL *assetURL;
|
||||
@property (nullable, nonatomic) NSURL *assetURL;
|
||||
|
||||
/// You should never set any value on the backing video node. Use exclusivively the video player node to set properties
|
||||
@property (nonatomic, strong, readonly) ASVideoNode *videoNode;
|
||||
@property (nonatomic, readonly) ASVideoNode *videoNode;
|
||||
|
||||
//! Defaults to 100
|
||||
@property (nonatomic, assign) int32_t periodicTimeObserverTimescale;
|
||||
@property (nonatomic) int32_t periodicTimeObserverTimescale;
|
||||
//! Defaults to AVLayerVideoGravityResizeAspect
|
||||
@property (nonatomic, copy) NSString *gravity;
|
||||
|
||||
|
||||
@ -51,7 +51,7 @@ NS_ASSUME_NONNULL_END
|
||||
/**
|
||||
* @return node Returns the ASDisplayNode which provides the backing view to the view controller.
|
||||
*/
|
||||
@property (nonatomic, strong, readonly, null_unspecified) DisplayNodeType node;
|
||||
@property (nonatomic, readonly, null_unspecified) DisplayNodeType node;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@ -76,7 +76,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
// AsyncDisplayKit 2.0 BETA: This property is still being tested, but it allows
|
||||
// blocking as a view controller becomes visible to ensure no placeholders flash onscreen.
|
||||
// Refer to examples/SynchronousConcurrency, AsyncViewController.m
|
||||
@property (nonatomic, assign) BOOL neverShowPlaceholders;
|
||||
@property (nonatomic) BOOL neverShowPlaceholders;
|
||||
|
||||
/* Custom container UIViewController subclasses can use this property to add to the overlay
|
||||
that UIViewController calculates for the safeAreaInsets for contained view controllers.
|
||||
@ -93,7 +93,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
*
|
||||
* Default value is YES *if* node or view controller conform to ASRangeControllerUpdateRangeProtocol otherwise it is NO.
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL automaticallyAdjustRangeModeBasedOnViewEvents;
|
||||
@property (nonatomic) BOOL automaticallyAdjustRangeModeBasedOnViewEvents;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@ -35,12 +35,12 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
* Note: If this property is read on the main thread, the enumeration will attempt to go up
|
||||
* the layer hierarchy if it finds a break in the display node hierarchy.
|
||||
*/
|
||||
@property (atomic, readonly) id<NSFastEnumeration> supernodes;
|
||||
@property (readonly) id<NSFastEnumeration> supernodes;
|
||||
|
||||
/**
|
||||
* Same as `supernodes` but begins the enumeration with self.
|
||||
*/
|
||||
@property (atomic, readonly) id<NSFastEnumeration> supernodesIncludingSelf;
|
||||
@property (readonly) id<NSFastEnumeration> supernodesIncludingSelf;
|
||||
|
||||
/**
|
||||
* Searches the supernodes of this node for one matching the given class.
|
||||
@ -56,7 +56,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/**
|
||||
* e.g. "(<MYTextNode: 0xFFFF>, <MYTextContainingNode: 0xFFFF>, <MYCellNode: 0xFFFF>)"
|
||||
*/
|
||||
@property (atomic, copy, readonly) NSString *ancestryDescription;
|
||||
@property (copy, readonly) NSString *ancestryDescription;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@ -230,8 +230,8 @@ static BOOL __enableHitTestDebug = NO;
|
||||
@interface _ASRangeDebugBarView : UIView
|
||||
|
||||
@property (nonatomic, weak) ASRangeController *rangeController;
|
||||
@property (nonatomic, assign) BOOL destroyOnLayout;
|
||||
@property (nonatomic, strong) NSString *debugString;
|
||||
@property (nonatomic) BOOL destroyOnLayout;
|
||||
@property (nonatomic) NSString *debugString;
|
||||
|
||||
- (instancetype)initWithRangeController:(ASRangeController *)rangeController;
|
||||
|
||||
|
||||
@ -44,7 +44,7 @@ typedef void(^ASTipDisplayBlock)(ASDisplayNode *node, NSString *message);
|
||||
* If nil, the default, the message is just logged to the console with the
|
||||
* ancestry of the node.
|
||||
*/
|
||||
@property (class, nonatomic, copy, null_resettable) ASTipDisplayBlock tipDisplayBlock;
|
||||
@property (class, nonatomic, null_resettable) ASTipDisplayBlock tipDisplayBlock;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@ -39,7 +39,7 @@ NSString * const kASBasicImageDownloaderContextCompletionBlock = @"kASBasicImage
|
||||
ASDN::RecursiveMutex __instanceLock__;
|
||||
}
|
||||
|
||||
@property (nonatomic, strong) NSMutableArray *callbackDatas;
|
||||
@property (nonatomic) NSMutableArray *callbackDatas;
|
||||
|
||||
@end
|
||||
|
||||
@ -179,7 +179,7 @@ static ASDN::StaticMutex& currentRequestsLock = *new ASDN::StaticMutex;
|
||||
* NSURLSessionDownloadTask lacks a `userInfo` property, so add this association ourselves.
|
||||
*/
|
||||
@interface NSURLRequest (ASBasicImageDownloader)
|
||||
@property (nonatomic, strong) ASBasicImageDownloaderContext *asyncdisplaykit_context;
|
||||
@property (nonatomic) ASBasicImageDownloaderContext *asyncdisplaykit_context;
|
||||
@end
|
||||
|
||||
@implementation NSURLRequest (ASBasicImageDownloader)
|
||||
|
||||
@ -26,11 +26,11 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
AS_SUBCLASSING_RESTRICTED
|
||||
@interface ASCollectionElement : NSObject
|
||||
|
||||
@property (nonatomic, readonly, copy, nullable) NSString *supplementaryElementKind;
|
||||
@property (nonatomic, assign) ASSizeRange constrainedSize;
|
||||
@property (nonatomic, readonly, weak) id<ASRangeManagingNode> owningNode;
|
||||
@property (nonatomic, assign) ASPrimitiveTraitCollection traitCollection;
|
||||
@property (nonatomic, readonly, nullable) id nodeModel;
|
||||
@property (nullable, nonatomic, copy, readonly) NSString *supplementaryElementKind;
|
||||
@property (nonatomic) ASSizeRange constrainedSize;
|
||||
@property (nonatomic, weak, readonly) id<ASRangeManagingNode> owningNode;
|
||||
@property (nonatomic) ASPrimitiveTraitCollection traitCollection;
|
||||
@property (nullable, nonatomic, readonly) id nodeModel;
|
||||
|
||||
- (instancetype)initWithNodeModel:(nullable id)nodeModel
|
||||
nodeBlock:(ASCellNodeBlock)nodeBlock
|
||||
@ -43,12 +43,12 @@ AS_SUBCLASSING_RESTRICTED
|
||||
* @return The node, running the node block if necessary. The node block will be discarded
|
||||
* after the first time it is run.
|
||||
*/
|
||||
@property (strong, readonly) ASCellNode *node;
|
||||
@property (readonly) ASCellNode *node;
|
||||
|
||||
/**
|
||||
* @return The node, if the node block has been run already.
|
||||
*/
|
||||
@property (strong, readonly, nullable) ASCellNode *nodeIfAllocated;
|
||||
@property (nullable, readonly) ASCellNode *nodeIfAllocated;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
@interface ASCollectionElement ()
|
||||
|
||||
/// Required node block used to allocate a cell node. Nil after the first execution.
|
||||
@property (nonatomic, strong) ASCellNodeBlock nodeBlock;
|
||||
@property (nonatomic) ASCellNodeBlock nodeBlock;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@ -27,19 +27,19 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@interface ASCollectionView ()
|
||||
- (instancetype)_initWithFrame:(CGRect)frame collectionViewLayout:(UICollectionViewLayout *)layout layoutFacilitator:(nullable id<ASCollectionViewLayoutFacilitatorProtocol>)layoutFacilitator owningNode:(nullable ASCollectionNode *)owningNode eventLog:(nullable ASEventLog *)eventLog;
|
||||
|
||||
@property (nonatomic, weak, readwrite) ASCollectionNode *collectionNode;
|
||||
@property (nonatomic, strong, readonly) ASDataController *dataController;
|
||||
@property (nonatomic, strong, readonly) ASRangeController *rangeController;
|
||||
@property (nonatomic, weak) ASCollectionNode *collectionNode;
|
||||
@property (nonatomic, readonly) ASDataController *dataController;
|
||||
@property (nonatomic, readonly) ASRangeController *rangeController;
|
||||
|
||||
/**
|
||||
* The change set that we're currently building, if any.
|
||||
*/
|
||||
@property (nonatomic, strong, nullable, readonly) _ASHierarchyChangeSet *changeSet;
|
||||
@property (nonatomic, nullable, readonly) _ASHierarchyChangeSet *changeSet;
|
||||
|
||||
/**
|
||||
* @see ASCollectionNode+Beta.h for full documentation.
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL usesSynchronousDataLoading;
|
||||
@property (nonatomic) BOOL usesSynchronousDataLoading;
|
||||
|
||||
/**
|
||||
* Attempt to get the view-layer index path for the item with the given index path.
|
||||
|
||||
@ -26,13 +26,13 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
AS_SUBCLASSING_RESTRICTED
|
||||
@interface ASCollectionLayoutContext : NSObject
|
||||
|
||||
@property (nonatomic, assign, readonly) CGSize viewportSize;
|
||||
@property (nonatomic, assign, readonly) CGPoint initialContentOffset;
|
||||
@property (nonatomic, assign, readonly) ASScrollDirection scrollableDirections;
|
||||
@property (nonatomic, readonly) CGSize viewportSize;
|
||||
@property (nonatomic, readonly) CGPoint initialContentOffset;
|
||||
@property (nonatomic, readonly) ASScrollDirection scrollableDirections;
|
||||
@property (nonatomic, weak, readonly) ASElementMap *elements;
|
||||
@property (nonatomic, strong, readonly, nullable) id additionalInfo;
|
||||
@property (nullable, nonatomic, readonly) id additionalInfo;
|
||||
|
||||
- (instancetype)init __unavailable;
|
||||
- (instancetype)init NS_UNAVAILABLE;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@ -37,12 +37,12 @@ AS_SUBCLASSING_RESTRICTED
|
||||
@interface ASCollectionLayoutState : NSObject
|
||||
|
||||
/// The context used to calculate this object
|
||||
@property (nonatomic, strong, readonly) ASCollectionLayoutContext *context;
|
||||
@property (readonly) ASCollectionLayoutContext *context;
|
||||
|
||||
/// The final content size of the collection's layout
|
||||
@property (nonatomic, assign, readonly) CGSize contentSize;
|
||||
@property (readonly) CGSize contentSize;
|
||||
|
||||
- (instancetype)init __unavailable;
|
||||
- (instancetype)init NS_UNAVAILABLE;
|
||||
|
||||
/**
|
||||
* Designated initializer.
|
||||
|
||||
@ -37,6 +37,8 @@
|
||||
|
||||
@implementation ASCollectionLayoutState {
|
||||
ASDN::Mutex __instanceLock__;
|
||||
CGSize _contentSize;
|
||||
ASCollectionLayoutContext *_context;
|
||||
NSMapTable<ASCollectionElement *, UICollectionViewLayoutAttributes *> *_elementToLayoutAttributesTable;
|
||||
ASPageToLayoutAttributesTable *_pageToLayoutAttributesTable;
|
||||
ASPageToLayoutAttributesTable *_unmeasuredPageToLayoutAttributesTable;
|
||||
@ -115,6 +117,16 @@ elementToLayoutAttributesTable:[NSMapTable elementToLayoutAttributesTable]];
|
||||
return self;
|
||||
}
|
||||
|
||||
- (ASCollectionLayoutContext *)context
|
||||
{
|
||||
return _context;
|
||||
}
|
||||
|
||||
- (CGSize)contentSize
|
||||
{
|
||||
return _contentSize;
|
||||
}
|
||||
|
||||
- (NSArray<UICollectionViewLayoutAttributes *> *)allLayoutAttributes
|
||||
{
|
||||
return [_elementToLayoutAttributesTable.objectEnumerator allObjects];
|
||||
|
||||
@ -168,21 +168,21 @@ extern NSString * const ASCollectionInvalidUpdateException;
|
||||
*
|
||||
* NOTE: Soon we will drop support for using ASTableView/ASCollectionView without the node, so this will be non-null.
|
||||
*/
|
||||
@property (nonatomic, nullable, weak, readonly) id<ASRangeManagingNode> node;
|
||||
@property (nullable, nonatomic, weak, readonly) id<ASRangeManagingNode> node;
|
||||
|
||||
/**
|
||||
* The map that is currently displayed. The "UIKit index space."
|
||||
*
|
||||
* This property will only be changed on the main thread.
|
||||
*/
|
||||
@property (atomic, copy, readonly) ASElementMap *visibleMap;
|
||||
@property (copy, readonly) ASElementMap *visibleMap;
|
||||
|
||||
/**
|
||||
* The latest map fetched from the data source. May be more recent than @c visibleMap.
|
||||
*
|
||||
* This property will only be changed on the main thread.
|
||||
*/
|
||||
@property (atomic, copy, readonly) ASElementMap *pendingMap;
|
||||
@property (copy, readonly) ASElementMap *pendingMap;
|
||||
|
||||
/**
|
||||
Data source for fetching data info.
|
||||
@ -227,13 +227,13 @@ extern NSString * const ASCollectionInvalidUpdateException;
|
||||
/*
|
||||
* @abstract The primitive event tracing object. You shouldn't directly use it to log event. Use the ASDataControllerLogEvent macro instead.
|
||||
*/
|
||||
@property (nonatomic, strong, readonly) ASEventLog *eventLog;
|
||||
@property (nonatomic, readonly) ASEventLog *eventLog;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @see ASCollectionNode+Beta.h for full documentation.
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL usesSynchronousDataLoading;
|
||||
@property (nonatomic) BOOL usesSynchronousDataLoading;
|
||||
|
||||
/** @name Data Updating */
|
||||
|
||||
|
||||
@ -87,8 +87,8 @@ typedef void (^ASDataControllerSynchronizationBlock)();
|
||||
} _dataSourceFlags;
|
||||
}
|
||||
|
||||
@property (atomic, copy, readwrite) ASElementMap *pendingMap;
|
||||
@property (atomic, copy, readwrite) ASElementMap *visibleMap;
|
||||
@property (copy) ASElementMap *pendingMap;
|
||||
@property (copy) ASElementMap *visibleMap;
|
||||
@end
|
||||
|
||||
@implementation ASDataController
|
||||
|
||||
@ -114,7 +114,7 @@ AS_SUBCLASSING_RESTRICTED
|
||||
/**
|
||||
* A very terse description e.g. { itemCounts = [ <S0: 1> <S1: 16> ] }
|
||||
*/
|
||||
@property (atomic, readonly) NSString *smallDescription;
|
||||
@property (readonly) NSString *smallDescription;
|
||||
|
||||
#pragma mark - Initialization -- Only Useful to ASDataController
|
||||
|
||||
|
||||
@ -26,15 +26,15 @@
|
||||
|
||||
@interface ASElementMap () <ASDescriptionProvider>
|
||||
|
||||
@property (nonatomic, strong, readonly) NSArray<ASSection *> *sections;
|
||||
@property (nonatomic, readonly) NSArray<ASSection *> *sections;
|
||||
|
||||
// Element -> IndexPath
|
||||
@property (nonatomic, strong, readonly) NSMapTable<ASCollectionElement *, NSIndexPath *> *elementToIndexPathMap;
|
||||
@property (nonatomic, readonly) NSMapTable<ASCollectionElement *, NSIndexPath *> *elementToIndexPathMap;
|
||||
|
||||
// The items, in a 2D array
|
||||
@property (nonatomic, strong, readonly) ASCollectionElementTwoDimensionalArray *sectionsOfItems;
|
||||
@property (nonatomic, readonly) ASCollectionElementTwoDimensionalArray *sectionsOfItems;
|
||||
|
||||
@property (nonatomic, strong, readonly) ASSupplementaryElementDictionary *supplementaryElements;
|
||||
@property (nonatomic, readonly) ASSupplementaryElementDictionary *supplementaryElements;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@ -41,7 +41,7 @@ AS_SUBCLASSING_RESTRICTED
|
||||
*/
|
||||
- (instancetype)initWithRects:(NSArray<NSValue *> *)rects;
|
||||
|
||||
@property (nullable, nonatomic, strong) __attribute__((NSObject)) CGColorRef highlightColor;
|
||||
@property (nullable, nonatomic) __attribute__((NSObject)) CGColorRef highlightColor;
|
||||
@property (nonatomic, weak) CALayer *targetLayer;
|
||||
|
||||
@end
|
||||
@ -52,7 +52,7 @@ AS_SUBCLASSING_RESTRICTED
|
||||
@summary Set to YES to indicate to a sublayer that this is where highlight overlay layers (for pressed states) should
|
||||
be added so that the highlight won't be clipped by a neighboring layer.
|
||||
*/
|
||||
@property (nonatomic, assign, setter=as_setAllowsHighlightDrawing:) BOOL as_allowsHighlightDrawing;
|
||||
@property (nonatomic, setter=as_setAllowsHighlightDrawing:) BOOL as_allowsHighlightDrawing;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@ -164,7 +164,7 @@ withDownloadIdentifier:(id)downloadIdentifier;
|
||||
/**
|
||||
@abstract A block which receives the cover image. Should be called when the objects cover image is ready.
|
||||
*/
|
||||
@property (nonatomic, readwrite) void (^coverImageReadyCallback)(UIImage *coverImage);
|
||||
@property (nonatomic) void (^coverImageReadyCallback)(UIImage *coverImage);
|
||||
|
||||
/**
|
||||
@abstract Returns whether the supplied data contains a supported animated image format.
|
||||
@ -210,7 +210,7 @@ withDownloadIdentifier:(id)downloadIdentifier;
|
||||
/**
|
||||
@abstract Should be called when playback is ready.
|
||||
*/
|
||||
@property (nonatomic, readwrite) dispatch_block_t playbackReadyCallback;
|
||||
@property (nonatomic) dispatch_block_t playbackReadyCallback;
|
||||
|
||||
/**
|
||||
@abstract Return the image at a given index.
|
||||
|
||||
@ -36,7 +36,7 @@ AS_SUBCLASSING_RESTRICTED
|
||||
*
|
||||
* Note: You cannot mutate this.
|
||||
*/
|
||||
@property (class, atomic, readonly) ASIntegerMap *identityMap;
|
||||
@property (class, readonly) ASIntegerMap *identityMap;
|
||||
+ (ASIntegerMap *)identityMap NS_RETURNS_RETAINED;
|
||||
|
||||
/**
|
||||
@ -44,7 +44,7 @@ AS_SUBCLASSING_RESTRICTED
|
||||
*
|
||||
* Note: You cannot mutate this.
|
||||
*/
|
||||
@property (class, atomic, readonly) ASIntegerMap *emptyMap;
|
||||
@property (class, readonly) ASIntegerMap *emptyMap;
|
||||
+ (ASIntegerMap *)emptyMap NS_RETURNS_RETAINED;
|
||||
|
||||
/**
|
||||
|
||||
@ -76,7 +76,7 @@
|
||||
@end
|
||||
|
||||
@protocol ASPINDiskCache
|
||||
@property (assign) NSUInteger byteLimit;
|
||||
@property NSUInteger byteLimit;
|
||||
@end
|
||||
|
||||
@interface ASPINRemoteImageManager : PINRemoteImageManager
|
||||
|
||||
@ -59,7 +59,7 @@ API_AVAILABLE(ios(8.0), tvos(10.0))
|
||||
@discussion Some properties of this object are ignored when converting this request into a URL.
|
||||
As of iOS SDK 9.0, these properties are `progressHandler` and `synchronous`.
|
||||
*/
|
||||
@property (nonatomic, strong) PHImageRequestOptions *options;
|
||||
@property (nonatomic) PHImageRequestOptions *options;
|
||||
|
||||
/**
|
||||
@return A new URL converted from this request.
|
||||
|
||||
@ -88,7 +88,7 @@ AS_SUBCLASSING_RESTRICTED
|
||||
* Used primarily for providing the current range of index paths and identifying when the
|
||||
* range controller should invalidate its range.
|
||||
*/
|
||||
@property (nonatomic, strong) id<ASLayoutController> layoutController;
|
||||
@property (nonatomic) id<ASLayoutController> layoutController;
|
||||
|
||||
/**
|
||||
* The underlying data source for the range controller
|
||||
@ -103,7 +103,7 @@ AS_SUBCLASSING_RESTRICTED
|
||||
/**
|
||||
* Property that indicates whether the scroll view for this range controller has ever changed its contentOffset.
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL contentHasBeenScrolled;
|
||||
@property (nonatomic) BOOL contentHasBeenScrolled;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@ -32,7 +32,7 @@ AS_SUBCLASSING_RESTRICTED
|
||||
|
||||
// Will be nil unless AS_SAVE_EVENT_BACKTRACES=1 (default=0)
|
||||
@property (nonatomic, nullable, readonly) NSArray<NSString *> *backtrace;
|
||||
@property (nonatomic, strong, readonly) NSString *message;
|
||||
@property (nonatomic, readonly) NSString *message;
|
||||
@property (nonatomic, readonly) NSTimeInterval timestamp;
|
||||
|
||||
@end
|
||||
|
||||
@ -21,8 +21,8 @@
|
||||
static NSString *const ASTraceEventThreadDescriptionKey = @"ASThreadTraceEventDescription";
|
||||
|
||||
@interface ASTraceEvent ()
|
||||
@property (nonatomic, strong, readonly) NSString *objectDescription;
|
||||
@property (nonatomic, strong, readonly) NSString *threadDescription;
|
||||
@property (nonatomic, readonly) NSString *objectDescription;
|
||||
@property (nonatomic, readonly) NSString *threadDescription;
|
||||
@end
|
||||
|
||||
@implementation ASTraceEvent
|
||||
|
||||
@ -176,22 +176,22 @@ ASDISPLAYNODE_EXTERN_C_END
|
||||
AS_SUBCLASSING_RESTRICTED
|
||||
@interface ASTraitCollection : NSObject
|
||||
|
||||
@property (nonatomic, assign, readonly) UIUserInterfaceSizeClass horizontalSizeClass;
|
||||
@property (nonatomic, assign, readonly) UIUserInterfaceSizeClass verticalSizeClass;
|
||||
@property (nonatomic, readonly) UIUserInterfaceSizeClass horizontalSizeClass;
|
||||
@property (nonatomic, readonly) UIUserInterfaceSizeClass verticalSizeClass;
|
||||
|
||||
@property (nonatomic, assign, readonly) CGFloat displayScale;
|
||||
@property (nonatomic, assign, readonly) UIDisplayGamut displayGamut;
|
||||
@property (nonatomic, readonly) CGFloat displayScale;
|
||||
@property (nonatomic, readonly) UIDisplayGamut displayGamut;
|
||||
|
||||
@property (nonatomic, assign, readonly) UIUserInterfaceIdiom userInterfaceIdiom;
|
||||
@property (nonatomic, assign, readonly) UIForceTouchCapability forceTouchCapability;
|
||||
@property (nonatomic, assign, readonly) UITraitEnvironmentLayoutDirection layoutDirection;
|
||||
@property (nonatomic, readonly) UIUserInterfaceIdiom userInterfaceIdiom;
|
||||
@property (nonatomic, readonly) UIForceTouchCapability forceTouchCapability;
|
||||
@property (nonatomic, readonly) UITraitEnvironmentLayoutDirection layoutDirection;
|
||||
#if TARGET_OS_TV
|
||||
@property (nonatomic, assign, readonly) UIUserInterfaceStyle userInterfaceStyle;
|
||||
@property (nonatomic, readonly) UIUserInterfaceStyle userInterfaceStyle;
|
||||
#endif
|
||||
|
||||
@property (nonatomic, assign, readonly) UIContentSizeCategory preferredContentSizeCategory;
|
||||
@property (nonatomic, readonly) UIContentSizeCategory preferredContentSizeCategory;
|
||||
|
||||
@property (nonatomic, assign, readonly) CGSize containerSize;
|
||||
@property (nonatomic, readonly) CGSize containerSize;
|
||||
|
||||
+ (ASTraitCollection *)traitCollectionWithUITraitCollection:(UITraitCollection *)traitCollection
|
||||
containerSize:(CGSize)windowSize NS_RETURNS_RETAINED;
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
#import <AsyncDisplayKit/ASWeakSet.h>
|
||||
|
||||
@interface ASWeakSet<__covariant ObjectType> ()
|
||||
@property (nonatomic, strong, readonly) NSHashTable<ObjectType> *hashTable;
|
||||
@property (nonatomic, readonly) NSHashTable<ObjectType> *hashTable;
|
||||
@end
|
||||
|
||||
@implementation ASWeakSet
|
||||
|
||||
@ -76,13 +76,13 @@ extern NSInteger const ASDefaultTransactionPriority;
|
||||
/**
|
||||
A block that is called when the transaction is completed.
|
||||
*/
|
||||
@property (nonatomic, readonly, copy, nullable) asyncdisplaykit_async_transaction_completion_block_t completionBlock;
|
||||
@property (nullable, nonatomic, readonly) asyncdisplaykit_async_transaction_completion_block_t completionBlock;
|
||||
|
||||
/**
|
||||
The state of the transaction.
|
||||
@see ASAsyncTransactionState
|
||||
*/
|
||||
@property (readonly, assign) ASAsyncTransactionState state;
|
||||
@property (readonly) ASAsyncTransactionState state;
|
||||
|
||||
/**
|
||||
@summary Adds a synchronous operation to the transaction. The execution block will be executed immediately.
|
||||
|
||||
@ -36,8 +36,8 @@ NSInteger const ASDefaultTransactionPriority = 0;
|
||||
|
||||
@interface ASAsyncTransactionOperation : NSObject
|
||||
- (instancetype)initWithOperationCompletionBlock:(asyncdisplaykit_async_transaction_operation_completion_block_t)operationCompletionBlock;
|
||||
@property (nonatomic, copy) asyncdisplaykit_async_transaction_operation_completion_block_t operationCompletionBlock;
|
||||
@property (atomic, strong) id value; // set on bg queue by the operation block
|
||||
@property (nonatomic) asyncdisplaykit_async_transaction_operation_completion_block_t operationCompletionBlock;
|
||||
@property id value; // set on bg queue by the operation block
|
||||
@end
|
||||
|
||||
@implementation ASAsyncTransactionOperation
|
||||
@ -330,7 +330,7 @@ ASAsyncTransactionQueue & ASAsyncTransactionQueue::instance()
|
||||
}
|
||||
|
||||
@interface _ASAsyncTransaction ()
|
||||
@property (atomic) ASAsyncTransactionState state;
|
||||
@property ASAsyncTransactionState state;
|
||||
@end
|
||||
|
||||
|
||||
|
||||
@ -23,7 +23,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@class _ASAsyncTransaction;
|
||||
|
||||
@interface CALayer (ASAsyncTransactionContainerTransactions)
|
||||
@property (nonatomic, strong, nullable, setter=asyncdisplaykit_setAsyncLayerTransactions:) NSHashTable<_ASAsyncTransaction *> *asyncdisplaykit_asyncLayerTransactions;
|
||||
@property (nonatomic, nullable, setter=asyncdisplaykit_setAsyncLayerTransactions:) NSHashTable<_ASAsyncTransaction *> *asyncdisplaykit_asyncLayerTransactions;
|
||||
|
||||
- (void)asyncdisplaykit_asyncTransactionContainerWillBeginTransaction:(_ASAsyncTransaction *)transaction;
|
||||
- (void)asyncdisplaykit_asyncTransactionContainerDidCompleteTransaction:(_ASAsyncTransaction *)transaction;
|
||||
|
||||
@ -44,19 +44,19 @@ typedef NS_ENUM(NSUInteger, ASAsyncTransactionContainerState) {
|
||||
|
||||
@default NO
|
||||
*/
|
||||
@property (nonatomic, assign, getter=asyncdisplaykit_isAsyncTransactionContainer, setter=asyncdisplaykit_setAsyncTransactionContainer:) BOOL asyncdisplaykit_asyncTransactionContainer;
|
||||
@property (nonatomic, getter=asyncdisplaykit_isAsyncTransactionContainer, setter=asyncdisplaykit_setAsyncTransactionContainer:) BOOL asyncdisplaykit_asyncTransactionContainer;
|
||||
|
||||
/**
|
||||
@summary The current state of the receiver; indicates if it is currently performing asynchronous operations or if all operations have finished/canceled.
|
||||
*/
|
||||
@property (nonatomic, readonly, assign) ASAsyncTransactionContainerState asyncdisplaykit_asyncTransactionContainerState;
|
||||
@property (nonatomic, readonly) ASAsyncTransactionContainerState asyncdisplaykit_asyncTransactionContainerState;
|
||||
|
||||
/**
|
||||
@summary Cancels all async transactions on the receiver.
|
||||
*/
|
||||
- (void)asyncdisplaykit_cancelAsyncTransactions;
|
||||
|
||||
@property (nonatomic, strong, nullable, setter=asyncdisplaykit_setCurrentAsyncTransaction:) _ASAsyncTransaction *asyncdisplaykit_currentAsyncTransaction;
|
||||
@property (nullable, nonatomic, setter=asyncdisplaykit_setCurrentAsyncTransaction:) _ASAsyncTransaction *asyncdisplaykit_currentAsyncTransaction;
|
||||
|
||||
@end
|
||||
|
||||
@ -66,13 +66,13 @@ typedef NS_ENUM(NSUInteger, ASAsyncTransactionContainerState) {
|
||||
did not already exist. This method will always return an open, uncommitted transaction.
|
||||
@desc asyncdisplaykit_isAsyncTransactionContainer does not need to be YES for this to return a transaction.
|
||||
*/
|
||||
@property (nonatomic, readonly, strong, nullable) _ASAsyncTransaction *asyncdisplaykit_asyncTransaction;
|
||||
@property (nullable, nonatomic, readonly) _ASAsyncTransaction *asyncdisplaykit_asyncTransaction;
|
||||
|
||||
/**
|
||||
@summary Goes up the superlayer chain until it finds the first layer with asyncdisplaykit_isAsyncTransactionContainer=YES (including the receiver) and returns it.
|
||||
Returns nil if no parent container is found.
|
||||
*/
|
||||
@property (nonatomic, readonly, strong, nullable) CALayer *asyncdisplaykit_parentTransactionContainer;
|
||||
@property (nullable, nonatomic, readonly) CALayer *asyncdisplaykit_parentTransactionContainer;
|
||||
@end
|
||||
|
||||
@interface UIView (ASAsyncTransactionContainer) <ASAsyncTransactionContainer>
|
||||
|
||||
@ -26,30 +26,30 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@protocol ASDisplayProperties <NSObject>
|
||||
|
||||
@property (nonatomic, assign) CGPoint position;
|
||||
@property (nonatomic, assign) CGFloat zPosition;
|
||||
@property (nonatomic, assign) CGPoint anchorPoint;
|
||||
@property (nonatomic, assign) CGFloat cornerRadius;
|
||||
@property (nullable, nonatomic, strong) id contents;
|
||||
@property (nonatomic) CGPoint position;
|
||||
@property (nonatomic) CGFloat zPosition;
|
||||
@property (nonatomic) CGPoint anchorPoint;
|
||||
@property (nonatomic) CGFloat cornerRadius;
|
||||
@property (nullable, nonatomic) id contents;
|
||||
@property (nonatomic, copy) NSString *contentsGravity;
|
||||
@property (nonatomic, assign) CGRect contentsRect;
|
||||
@property (nonatomic, assign) CGRect contentsCenter;
|
||||
@property (nonatomic, assign) CGFloat contentsScale;
|
||||
@property (nonatomic, assign) CGFloat rasterizationScale;
|
||||
@property (nonatomic, assign) CATransform3D transform;
|
||||
@property (nonatomic, assign) CATransform3D sublayerTransform;
|
||||
@property (nonatomic, assign) BOOL needsDisplayOnBoundsChange;
|
||||
@property (nonatomic, strong) __attribute__((NSObject)) CGColorRef shadowColor;
|
||||
@property (nonatomic, assign) CGFloat shadowOpacity;
|
||||
@property (nonatomic, assign) CGSize shadowOffset;
|
||||
@property (nonatomic, assign) CGFloat shadowRadius;
|
||||
@property (nonatomic, assign) CGFloat borderWidth;
|
||||
@property (nonatomic, assign, getter = isOpaque) BOOL opaque;
|
||||
@property (nonatomic, strong) __attribute__((NSObject)) CGColorRef borderColor;
|
||||
@property (nonatomic, strong) __attribute__((NSObject)) CGColorRef backgroundColor;
|
||||
@property (nonatomic, assign) BOOL allowsGroupOpacity;
|
||||
@property (nonatomic, assign) BOOL allowsEdgeAntialiasing;
|
||||
@property (nonatomic, assign) unsigned int edgeAntialiasingMask;
|
||||
@property (nonatomic) CGRect contentsRect;
|
||||
@property (nonatomic) CGRect contentsCenter;
|
||||
@property (nonatomic) CGFloat contentsScale;
|
||||
@property (nonatomic) CGFloat rasterizationScale;
|
||||
@property (nonatomic) CATransform3D transform;
|
||||
@property (nonatomic) CATransform3D sublayerTransform;
|
||||
@property (nonatomic) BOOL needsDisplayOnBoundsChange;
|
||||
@property (nonatomic) __attribute__((NSObject)) CGColorRef shadowColor;
|
||||
@property (nonatomic) CGFloat shadowOpacity;
|
||||
@property (nonatomic) CGSize shadowOffset;
|
||||
@property (nonatomic) CGFloat shadowRadius;
|
||||
@property (nonatomic) CGFloat borderWidth;
|
||||
@property (nonatomic, getter = isOpaque) BOOL opaque;
|
||||
@property (nonatomic) __attribute__((NSObject)) CGColorRef borderColor;
|
||||
@property (nonatomic) __attribute__((NSObject)) CGColorRef backgroundColor;
|
||||
@property (nonatomic) BOOL allowsGroupOpacity;
|
||||
@property (nonatomic) BOOL allowsEdgeAntialiasing;
|
||||
@property (nonatomic) unsigned int edgeAntialiasingMask;
|
||||
|
||||
- (void)setNeedsDisplay;
|
||||
- (void)setNeedsLayout;
|
||||
@ -62,41 +62,41 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
*/
|
||||
@protocol ASDisplayNodeViewProperties
|
||||
|
||||
@property (nonatomic, assign) BOOL clipsToBounds;
|
||||
@property (nonatomic) BOOL clipsToBounds;
|
||||
@property (nonatomic, getter=isHidden) BOOL hidden;
|
||||
@property (nonatomic, assign) BOOL autoresizesSubviews;
|
||||
@property (nonatomic, assign) UIViewAutoresizing autoresizingMask;
|
||||
@property (nonatomic, strong, null_resettable) UIColor *tintColor;
|
||||
@property (nonatomic, assign) CGFloat alpha;
|
||||
@property (nonatomic, assign) CGRect bounds;
|
||||
@property (nonatomic, assign) CGRect frame; // Only for use with nodes wrapping synchronous views
|
||||
@property (nonatomic, assign) UIViewContentMode contentMode;
|
||||
@property (nonatomic, assign) UISemanticContentAttribute semanticContentAttribute API_AVAILABLE(ios(9.0), tvos(9.0));
|
||||
@property (nonatomic, assign, getter=isUserInteractionEnabled) BOOL userInteractionEnabled;
|
||||
@property (nonatomic, assign, getter=isExclusiveTouch) BOOL exclusiveTouch;
|
||||
@property (nonatomic, assign, getter=asyncdisplaykit_isAsyncTransactionContainer, setter = asyncdisplaykit_setAsyncTransactionContainer:) BOOL asyncdisplaykit_asyncTransactionContainer;
|
||||
@property (nonatomic, assign) UIEdgeInsets layoutMargins;
|
||||
@property (nonatomic, assign) BOOL preservesSuperviewLayoutMargins;
|
||||
@property (nonatomic, assign) BOOL insetsLayoutMarginsFromSafeArea;
|
||||
@property (nonatomic) BOOL autoresizesSubviews;
|
||||
@property (nonatomic) UIViewAutoresizing autoresizingMask;
|
||||
@property (nonatomic, null_resettable) UIColor *tintColor;
|
||||
@property (nonatomic) CGFloat alpha;
|
||||
@property (nonatomic) CGRect bounds;
|
||||
@property (nonatomic) CGRect frame; // Only for use with nodes wrapping synchronous views
|
||||
@property (nonatomic) UIViewContentMode contentMode;
|
||||
@property (nonatomic) UISemanticContentAttribute semanticContentAttribute API_AVAILABLE(ios(9.0), tvos(9.0));
|
||||
@property (nonatomic, getter=isUserInteractionEnabled) BOOL userInteractionEnabled;
|
||||
@property (nonatomic, getter=isExclusiveTouch) BOOL exclusiveTouch;
|
||||
@property (nonatomic, getter=asyncdisplaykit_isAsyncTransactionContainer, setter = asyncdisplaykit_setAsyncTransactionContainer:) BOOL asyncdisplaykit_asyncTransactionContainer;
|
||||
@property (nonatomic) UIEdgeInsets layoutMargins;
|
||||
@property (nonatomic) BOOL preservesSuperviewLayoutMargins;
|
||||
@property (nonatomic) BOOL insetsLayoutMarginsFromSafeArea;
|
||||
|
||||
/**
|
||||
Following properties of the UIAccessibility informal protocol are supported as well.
|
||||
We don't declare them here, so _ASPendingState does not complain about them being not implemented,
|
||||
as they are already on NSObject
|
||||
|
||||
@property (nonatomic, assign) BOOL isAccessibilityElement;
|
||||
@property (nonatomic) BOOL isAccessibilityElement;
|
||||
@property (nonatomic, copy, nullable) NSString *accessibilityLabel;
|
||||
@property (nonatomic, copy, nullable) NSAttributedString *accessibilityAttributedLabel API_AVAILABLE(ios(11.0),tvos(11.0));
|
||||
@property (nonatomic, copy, nullable) NSString *accessibilityHint;
|
||||
@property (nonatomic, copy, nullable) NSAttributedString *accessibilityAttributedHint API_AVAILABLE(ios(11.0),tvos(11.0));
|
||||
@property (nonatomic, copy, nullable) NSString *accessibilityValue;
|
||||
@property (nonatomic, copy, nullable) NSAttributedString *accessibilityAttributedValue API_AVAILABLE(ios(11.0),tvos(11.0));
|
||||
@property (nonatomic, assign) UIAccessibilityTraits accessibilityTraits;
|
||||
@property (nonatomic, assign) CGRect accessibilityFrame;
|
||||
@property (nonatomic, strong, nullable) NSString *accessibilityLanguage;
|
||||
@property (nonatomic, assign) BOOL accessibilityElementsHidden;
|
||||
@property (nonatomic, assign) BOOL accessibilityViewIsModal;
|
||||
@property (nonatomic, assign) BOOL shouldGroupAccessibilityChildren;
|
||||
@property (nonatomic) UIAccessibilityTraits accessibilityTraits;
|
||||
@property (nonatomic) CGRect accessibilityFrame;
|
||||
@property (nonatomic, nullable) NSString *accessibilityLanguage;
|
||||
@property (nonatomic) BOOL accessibilityElementsHidden;
|
||||
@property (nonatomic) BOOL accessibilityViewIsModal;
|
||||
@property (nonatomic) BOOL shouldGroupAccessibilityChildren;
|
||||
*/
|
||||
|
||||
// Accessibility identification support
|
||||
|
||||
@ -25,9 +25,9 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
AS_SUBCLASSING_RESTRICTED // Note: ASDynamicCastStrict is used on instances of this class based on this restriction.
|
||||
@interface _ASCollectionReusableView : UICollectionReusableView
|
||||
|
||||
@property (nonatomic, strong, readonly, nullable) ASCellNode *node;
|
||||
@property (nonatomic, strong, nullable) ASCollectionElement *element;
|
||||
@property (nonatomic, strong, nullable) UICollectionViewLayoutAttributes *layoutAttributes;
|
||||
@property (nullable, nonatomic, readonly) ASCellNode *node;
|
||||
@property (nullable, nonatomic) ASCollectionElement *element;
|
||||
@property (nullable, nonatomic) UICollectionViewLayoutAttributes *layoutAttributes;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@ -26,9 +26,9 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
AS_SUBCLASSING_RESTRICTED // Note: ASDynamicCastStrict is used on instances of this class based on this restriction.
|
||||
@interface _ASCollectionViewCell : UICollectionViewCell
|
||||
|
||||
@property (nonatomic, strong, nullable) ASCollectionElement *element;
|
||||
@property (nonatomic, strong, readonly, nullable) ASCellNode *node;
|
||||
@property (nonatomic, strong, nullable) UICollectionViewLayoutAttributes *layoutAttributes;
|
||||
@property (nonatomic, nullable) ASCollectionElement *element;
|
||||
@property (nullable, nonatomic, readonly) ASCellNode *node;
|
||||
@property (nonatomic, nullable) UICollectionViewLayoutAttributes *layoutAttributes;
|
||||
|
||||
/**
|
||||
* Whether or not this cell is interested in cell node visibility events.
|
||||
|
||||
@ -37,7 +37,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@default YES (note that this might change for subclasses)
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL displaysAsynchronously;
|
||||
@property (nonatomic) BOOL displaysAsynchronously;
|
||||
|
||||
/**
|
||||
@summary Cancels any pending async display.
|
||||
@ -59,7 +59,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@desc The asyncDelegate will have the opportunity to override the methods related to async display.
|
||||
*/
|
||||
@property (nullable, atomic, weak) id<_ASDisplayLayerDelegate> asyncDelegate;
|
||||
@property (nullable, weak) id<_ASDisplayLayerDelegate> asyncDelegate;
|
||||
|
||||
/**
|
||||
@summary Suspends both asynchronous and synchronous display of the receiver if YES.
|
||||
@ -69,7 +69,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@default NO
|
||||
*/
|
||||
@property (nonatomic, assign, getter=isDisplaySuspended) BOOL displaySuspended;
|
||||
@property (nonatomic, getter=isDisplaySuspended) BOOL displaySuspended;
|
||||
|
||||
/**
|
||||
@summary Bypasses asynchronous rendering and performs a blocking display immediately on the current thread.
|
||||
|
||||
@ -77,7 +77,7 @@ static _ASDisplayViewMethodOverrides GetASDisplayViewMethodOverrides(Class c)
|
||||
|
||||
// Keep the node alive while its view is active. If you create a view, add its layer to a layer hierarchy, then release
|
||||
// the view, the layer retains the view to prevent a crash. This replicates this behaviour for the node abstraction.
|
||||
@property (nonatomic, strong, readwrite) ASDisplayNode *keepalive_node;
|
||||
@property (nonatomic) ASDisplayNode *keepalive_node;
|
||||
@end
|
||||
|
||||
@implementation _ASDisplayView
|
||||
|
||||
@ -65,8 +65,8 @@ static void SortAccessibilityElements(NSMutableArray *elements)
|
||||
|
||||
@interface ASAccessibilityElement : UIAccessibilityElement<ASAccessibilityElementPositioning>
|
||||
|
||||
@property (nonatomic, strong) ASDisplayNode *node;
|
||||
@property (nonatomic, strong) ASDisplayNode *containerNode;
|
||||
@property (nonatomic) ASDisplayNode *node;
|
||||
@property (nonatomic) ASDisplayNode *containerNode;
|
||||
|
||||
+ (ASAccessibilityElement *)accessibilityElementWithContainer:(UIView *)container node:(ASDisplayNode *)node containerNode:(ASDisplayNode *)containerNode;
|
||||
|
||||
@ -107,9 +107,9 @@ static void SortAccessibilityElements(NSMutableArray *elements)
|
||||
|
||||
@interface ASAccessibilityCustomAction : UIAccessibilityCustomAction<ASAccessibilityElementPositioning>
|
||||
|
||||
@property (nonatomic, strong) UIView *container;
|
||||
@property (nonatomic, strong) ASDisplayNode *node;
|
||||
@property (nonatomic, strong) ASDisplayNode *containerNode;
|
||||
@property (nonatomic) UIView *container;
|
||||
@property (nonatomic) ASDisplayNode *node;
|
||||
@property (nonatomic) ASDisplayNode *containerNode;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@ -27,7 +27,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/**
|
||||
* @abstract The position of this object within its parent spec.
|
||||
*/
|
||||
@property (nonatomic, assign) CGPoint layoutPosition;
|
||||
@property (nonatomic) CGPoint layoutPosition;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@ -35,7 +35,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/**
|
||||
How much space will the spec taken up
|
||||
*/
|
||||
@property (nonatomic, assign) ASAbsoluteLayoutSpecSizing sizing;
|
||||
@property (nonatomic) ASAbsoluteLayoutSpecSizing sizing;
|
||||
|
||||
/**
|
||||
@param sizing How much space the spec will take up
|
||||
|
||||
@ -27,7 +27,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/**
|
||||
* Background layoutElement for this layout spec
|
||||
*/
|
||||
@property (nonatomic, strong) id<ASLayoutElement> background;
|
||||
@property (nonatomic) id<ASLayoutElement> background;
|
||||
|
||||
/**
|
||||
* Creates and returns an ASBackgroundLayoutSpec object
|
||||
|
||||
@ -59,8 +59,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
*/
|
||||
@interface ASCenterLayoutSpec : ASRelativeLayoutSpec
|
||||
|
||||
@property (nonatomic, assign) ASCenterLayoutSpecCenteringOptions centeringOptions;
|
||||
@property (nonatomic, assign) ASCenterLayoutSpecSizingOptions sizingOptions;
|
||||
@property (nonatomic) ASCenterLayoutSpecCenteringOptions centeringOptions;
|
||||
@property (nonatomic) ASCenterLayoutSpecSizingOptions sizingOptions;
|
||||
|
||||
/**
|
||||
* Initializer.
|
||||
|
||||
@ -54,25 +54,25 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/**
|
||||
A layoutElement object that is laid out to a corner on the child.
|
||||
*/
|
||||
@property (nonatomic, strong) id <ASLayoutElement> corner;
|
||||
@property (nonatomic) id <ASLayoutElement> corner;
|
||||
|
||||
/**
|
||||
The corner position option.
|
||||
*/
|
||||
@property (nonatomic, assign) ASCornerLayoutLocation cornerLocation;
|
||||
@property (nonatomic) ASCornerLayoutLocation cornerLocation;
|
||||
|
||||
/**
|
||||
The point which offsets from the corner location. Use this property to make delta
|
||||
distance from the default corner location. Default is CGPointZero.
|
||||
*/
|
||||
@property (nonatomic, assign) CGPoint offset;
|
||||
@property (nonatomic) CGPoint offset;
|
||||
|
||||
/**
|
||||
Whether should include corner element into layout size calculation. If included,
|
||||
the layout size will be the union size of both child and corner; If not included,
|
||||
the layout size will be only child's size. Default is NO.
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL wrapsCorner;
|
||||
@property (nonatomic) BOOL wrapsCorner;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@ -38,7 +38,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
*/
|
||||
@interface ASInsetLayoutSpec : ASLayoutSpec
|
||||
|
||||
@property (nonatomic, assign) UIEdgeInsets insets;
|
||||
@property (nonatomic) UIEdgeInsets insets;
|
||||
|
||||
/**
|
||||
@param insets The amount of space to inset on each side.
|
||||
|
||||
@ -58,19 +58,19 @@ ASDISPLAYNODE_EXTERN_C_END
|
||||
/**
|
||||
* The type of ASLayoutElement that created this layout
|
||||
*/
|
||||
@property (nonatomic, assign, readonly) ASLayoutElementType type;
|
||||
@property (nonatomic, readonly) ASLayoutElementType type;
|
||||
|
||||
/**
|
||||
* Size of the current layout
|
||||
*/
|
||||
@property (nonatomic, assign, readonly) CGSize size;
|
||||
@property (nonatomic, readonly) CGSize size;
|
||||
|
||||
/**
|
||||
* Position in parent. Default to ASPointNull.
|
||||
*
|
||||
* @discussion When being used as a sublayout, this property must not equal ASPointNull.
|
||||
*/
|
||||
@property (nonatomic, assign, readonly) CGPoint position;
|
||||
@property (nonatomic, readonly) CGPoint position;
|
||||
|
||||
/**
|
||||
* Array of ASLayouts. Each must have a valid non-null position.
|
||||
@ -87,7 +87,7 @@ ASDISPLAYNODE_EXTERN_C_END
|
||||
* @abstract Returns a valid frame for the current layout computed with the size and position.
|
||||
* @discussion Clamps the layout's origin or position to 0 if any of the calculated values are infinite.
|
||||
*/
|
||||
@property (nonatomic, assign, readonly) CGRect frame;
|
||||
@property (nonatomic, readonly) CGRect frame;
|
||||
|
||||
/**
|
||||
* Designated initializer
|
||||
@ -143,7 +143,7 @@ ASDISPLAYNODE_EXTERN_C_END
|
||||
|
||||
@interface ASLayout (Unavailable)
|
||||
|
||||
- (instancetype)init __unavailable;
|
||||
- (instancetype)init NS_UNAVAILABLE;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@ -79,14 +79,14 @@ ASDISPLAYNODE_INLINE AS_WARN_UNUSED_RESULT BOOL ASLayoutIsFlattened(ASLayout *la
|
||||
/*
|
||||
* Caches all sublayouts if set to YES or destroys the sublayout cache if set to NO. Defaults to NO
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL retainSublayoutLayoutElements;
|
||||
@property (nonatomic) BOOL retainSublayoutLayoutElements;
|
||||
|
||||
/**
|
||||
* Array for explicitly retain sublayout layout elements in case they are created and references in layoutSpecThatFits: and no one else will hold a strong reference on it
|
||||
*/
|
||||
@property (nonatomic, strong) NSMutableArray<id<ASLayoutElement>> *sublayoutLayoutElements;
|
||||
@property (nonatomic) NSMutableArray<id<ASLayoutElement>> *sublayoutLayoutElements;
|
||||
|
||||
@property (nonatomic, strong, readonly) ASRectMap *elementToRectMap;
|
||||
@property (nonatomic, readonly) ASRectMap *elementToRectMap;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@ -68,12 +68,12 @@ typedef NS_ENUM(NSUInteger, ASLayoutElementType) {
|
||||
/**
|
||||
* @abstract Returns type of layoutElement
|
||||
*/
|
||||
@property (nonatomic, assign, readonly) ASLayoutElementType layoutElementType;
|
||||
@property (nonatomic, readonly) ASLayoutElementType layoutElementType;
|
||||
|
||||
/**
|
||||
* @abstract A size constraint that should apply to this ASLayoutElement.
|
||||
*/
|
||||
@property (nonatomic, strong, readonly) ASLayoutElementStyle *style;
|
||||
@property (nonatomic, readonly) ASLayoutElementStyle *style;
|
||||
|
||||
/**
|
||||
* @abstract Returns all children of an object which class conforms to the ASLayoutElement protocol
|
||||
@ -196,14 +196,14 @@ extern NSString * const ASLayoutElementStyleLayoutPositionProperty;
|
||||
* The minWidth and maxWidth properties override width.
|
||||
* Defaults to ASDimensionAuto
|
||||
*/
|
||||
@property (nonatomic, assign, readwrite) ASDimension width;
|
||||
@property (nonatomic) ASDimension width;
|
||||
|
||||
/**
|
||||
* @abstract The height property specifies the height of the content area of an ASLayoutElement
|
||||
* The minHeight and maxHeight properties override height.
|
||||
* Defaults to ASDimensionAuto
|
||||
*/
|
||||
@property (nonatomic, assign, readwrite) ASDimension height;
|
||||
@property (nonatomic) ASDimension height;
|
||||
|
||||
/**
|
||||
* @abstract The minHeight property is used to set the minimum height of a given element. It prevents the used value
|
||||
@ -211,7 +211,7 @@ extern NSString * const ASLayoutElementStyleLayoutPositionProperty;
|
||||
* The value of minHeight overrides both maxHeight and height.
|
||||
* Defaults to ASDimensionAuto
|
||||
*/
|
||||
@property (nonatomic, assign, readwrite) ASDimension minHeight;
|
||||
@property (nonatomic) ASDimension minHeight;
|
||||
|
||||
/**
|
||||
* @abstract The maxHeight property is used to set the maximum height of an element. It prevents the used value of the
|
||||
@ -219,7 +219,7 @@ extern NSString * const ASLayoutElementStyleLayoutPositionProperty;
|
||||
* The value of maxHeight overrides height, but minHeight overrides maxHeight.
|
||||
* Defaults to ASDimensionAuto
|
||||
*/
|
||||
@property (nonatomic, assign, readwrite) ASDimension maxHeight;
|
||||
@property (nonatomic) ASDimension maxHeight;
|
||||
|
||||
/**
|
||||
* @abstract The minWidth property is used to set the minimum width of a given element. It prevents the used value of
|
||||
@ -227,7 +227,7 @@ extern NSString * const ASLayoutElementStyleLayoutPositionProperty;
|
||||
* The value of minWidth overrides both maxWidth and width.
|
||||
* Defaults to ASDimensionAuto
|
||||
*/
|
||||
@property (nonatomic, assign, readwrite) ASDimension minWidth;
|
||||
@property (nonatomic) ASDimension minWidth;
|
||||
|
||||
/**
|
||||
* @abstract The maxWidth property is used to set the maximum width of a given element. It prevents the used value of
|
||||
@ -235,7 +235,7 @@ extern NSString * const ASLayoutElementStyleLayoutPositionProperty;
|
||||
* The value of maxWidth overrides width, but minWidth overrides maxWidth.
|
||||
* Defaults to ASDimensionAuto
|
||||
*/
|
||||
@property (nonatomic, assign, readwrite) ASDimension maxWidth;
|
||||
@property (nonatomic) ASDimension maxWidth;
|
||||
|
||||
#pragma mark - ASLayoutElementStyleSizeHelpers
|
||||
|
||||
@ -251,7 +251,7 @@ extern NSString * const ASLayoutElementStyleLayoutPositionProperty;
|
||||
*
|
||||
* @warning Calling the getter when the size's width or height are relative will cause an assert.
|
||||
*/
|
||||
@property (nonatomic, assign) CGSize preferredSize;
|
||||
@property (nonatomic) CGSize preferredSize;
|
||||
|
||||
/**
|
||||
* @abstract An optional property that provides a minimum size bound for a layout element. If provided, this restriction will
|
||||
@ -262,7 +262,7 @@ extern NSString * const ASLayoutElementStyleLayoutPositionProperty;
|
||||
* element in a full screen container, this would result in a width of 160 points on an iPhone screen. However,
|
||||
* since 160 pts is lower than the minimum width of 200 pts, the minimum width would be used.
|
||||
*/
|
||||
@property (nonatomic, assign) CGSize minSize;
|
||||
@property (nonatomic) CGSize minSize;
|
||||
- (CGSize)minSize UNAVAILABLE_ATTRIBUTE;
|
||||
|
||||
/**
|
||||
@ -274,7 +274,7 @@ extern NSString * const ASLayoutElementStyleLayoutPositionProperty;
|
||||
* element in a full screen container, this would result in a width of 160 points on an iPhone screen. However,
|
||||
* since 160 pts is higher than the maximum width of 120 pts, the maximum width would be used.
|
||||
*/
|
||||
@property (nonatomic, assign) CGSize maxSize;
|
||||
@property (nonatomic) CGSize maxSize;
|
||||
- (CGSize)maxSize UNAVAILABLE_ATTRIBUTE;
|
||||
|
||||
/**
|
||||
@ -284,21 +284,21 @@ extern NSString * const ASLayoutElementStyleLayoutPositionProperty;
|
||||
* will be enforced. If this optional value is not provided, the layout element’s size will default to its intrinsic content size
|
||||
* provided calculateSizeThatFits:
|
||||
*/
|
||||
@property (nonatomic, assign, readwrite) ASLayoutSize preferredLayoutSize;
|
||||
@property (nonatomic) ASLayoutSize preferredLayoutSize;
|
||||
|
||||
/**
|
||||
* @abstract An optional property that provides a minimum RELATIVE size bound for a layout element. If provided, this
|
||||
* restriction will always be enforced. If a parent layout element’s minimum relative size is smaller than its child’s minimum
|
||||
* relative size, the child’s minimum relative size will be enforced and its size will extend out of the layout spec’s.
|
||||
*/
|
||||
@property (nonatomic, assign, readwrite) ASLayoutSize minLayoutSize;
|
||||
@property (nonatomic) ASLayoutSize minLayoutSize;
|
||||
|
||||
/**
|
||||
* @abstract An optional property that provides a maximum RELATIVE size bound for a layout element. If provided, this
|
||||
* restriction will always be enforced. If a parent layout element’s maximum relative size is smaller than its child’s maximum
|
||||
* relative size, the child’s maximum relative size will be enforced and its size will extend out of the layout spec’s.
|
||||
*/
|
||||
@property (nonatomic, assign, readwrite) ASLayoutSize maxLayoutSize;
|
||||
@property (nonatomic) ASLayoutSize maxLayoutSize;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@ -60,7 +60,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
*
|
||||
* @discussion When being used as a sublayout, this property must not equal CGPointNull.
|
||||
*/
|
||||
@property (nonatomic, assign, readwrite) CGPoint position;
|
||||
@property (nonatomic) CGPoint position;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
#pragma mark - ASNullLayoutSpec
|
||||
|
||||
@interface ASNullLayoutSpec : ASLayoutSpec
|
||||
- (instancetype)init __unavailable;
|
||||
- (instancetype)init NS_UNAVAILABLE;
|
||||
+ (ASNullLayoutSpec *)null;
|
||||
@end
|
||||
|
||||
|
||||
@ -31,7 +31,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
* layout spec can be created and mutated. Once it is passed back to ASDK, the isMutable flag will be
|
||||
* set to NO and any further mutations will cause an assert.
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL isMutable;
|
||||
@property (nonatomic) BOOL isMutable;
|
||||
|
||||
/**
|
||||
* First child within the children's array.
|
||||
@ -46,7 +46,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
* setChild:atIndex: internally. For example, ASBackgroundLayoutSpec exposes a "background"
|
||||
* property that behind the scenes is calling setChild:atIndex:.
|
||||
*/
|
||||
@property (nullable, strong, nonatomic) id<ASLayoutElement> child;
|
||||
@property (nullable, nonatomic) id<ASLayoutElement> child;
|
||||
|
||||
/**
|
||||
* An array of ASLayoutElement children
|
||||
@ -57,7 +57,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
* For good measure, in these layout specs it probably makes sense to define
|
||||
* setChild: and setChild:forIdentifier: methods to do something appropriate or to assert.
|
||||
*/
|
||||
@property (nullable, strong, nonatomic) NSArray<id<ASLayoutElement>> *children;
|
||||
@property (nullable, nonatomic) NSArray<id<ASLayoutElement>> *children;
|
||||
|
||||
@end
|
||||
|
||||
@ -91,7 +91,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/*
|
||||
* Init not available for ASWrapperLayoutSpec
|
||||
*/
|
||||
- (instancetype)init __unavailable;
|
||||
- (instancetype)init NS_UNAVAILABLE;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@ -27,7 +27,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/**
|
||||
* Overlay layoutElement of this layout spec
|
||||
*/
|
||||
@property (nonatomic, strong) id<ASLayoutElement> overlay;
|
||||
@property (nonatomic) id<ASLayoutElement> overlay;
|
||||
|
||||
/**
|
||||
* Creates and returns an ASOverlayLayoutSpec object with a given child and an layoutElement that act as overlay.
|
||||
|
||||
@ -41,7 +41,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
**/
|
||||
@interface ASRatioLayoutSpec : ASLayoutSpec
|
||||
|
||||
@property (nonatomic, assign) CGFloat ratio;
|
||||
@property (nonatomic) CGFloat ratio;
|
||||
|
||||
+ (instancetype)ratioLayoutSpecWithRatio:(CGFloat)ratio child:(id<ASLayoutElement>)child NS_RETURNS_RETAINED AS_WARN_UNUSED_RESULT;
|
||||
|
||||
|
||||
@ -59,9 +59,9 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@interface ASRelativeLayoutSpec : ASLayoutSpec
|
||||
|
||||
// You may create a spec with alloc / init, then set any non-default properties; or use a convenience initialize that accepts all properties.
|
||||
@property (nonatomic, assign) ASRelativeLayoutSpecPosition horizontalPosition;
|
||||
@property (nonatomic, assign) ASRelativeLayoutSpecPosition verticalPosition;
|
||||
@property (nonatomic, assign) ASRelativeLayoutSpecSizingOption sizingOption;
|
||||
@property (nonatomic) ASRelativeLayoutSpecPosition horizontalPosition;
|
||||
@property (nonatomic) ASRelativeLayoutSpecPosition verticalPosition;
|
||||
@property (nonatomic) ASRelativeLayoutSpecSizingOption sizingOption;
|
||||
|
||||
/*!
|
||||
* @discussion convenience constructor for a ASRelativeLayoutSpec
|
||||
|
||||
@ -30,51 +30,51 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
* @abstract Additional space to place before this object in the stacking direction.
|
||||
* Used when attached to a stack layout.
|
||||
*/
|
||||
@property (nonatomic, readwrite) CGFloat spacingBefore;
|
||||
@property (nonatomic) CGFloat spacingBefore;
|
||||
|
||||
/**
|
||||
* @abstract Additional space to place after this object in the stacking direction.
|
||||
* Used when attached to a stack layout.
|
||||
*/
|
||||
@property (nonatomic, readwrite) CGFloat spacingAfter;
|
||||
@property (nonatomic) CGFloat spacingAfter;
|
||||
|
||||
/**
|
||||
* @abstract If the sum of childrens' stack dimensions is less than the minimum size, how much should this component grow?
|
||||
* This value represents the "flex grow factor" and determines how much this component should grow in relation to any
|
||||
* other flexible children.
|
||||
*/
|
||||
@property (nonatomic, readwrite) CGFloat flexGrow;
|
||||
@property (nonatomic) CGFloat flexGrow;
|
||||
|
||||
/**
|
||||
* @abstract If the sum of childrens' stack dimensions is greater than the maximum size, how much should this component shrink?
|
||||
* This value represents the "flex shrink factor" and determines how much this component should shink in relation to
|
||||
* other flexible children.
|
||||
*/
|
||||
@property (nonatomic, readwrite) CGFloat flexShrink;
|
||||
@property (nonatomic) CGFloat flexShrink;
|
||||
|
||||
/**
|
||||
* @abstract Specifies the initial size in the stack dimension for this object.
|
||||
* Defaults to ASDimensionAuto.
|
||||
* Used when attached to a stack layout.
|
||||
*/
|
||||
@property (nonatomic, readwrite) ASDimension flexBasis;
|
||||
@property (nonatomic) ASDimension flexBasis;
|
||||
|
||||
/**
|
||||
* @abstract Orientation of the object along cross axis, overriding alignItems.
|
||||
* Defaults to ASStackLayoutAlignSelfAuto.
|
||||
* Used when attached to a stack layout.
|
||||
*/
|
||||
@property (nonatomic, readwrite) ASStackLayoutAlignSelf alignSelf;
|
||||
@property (nonatomic) ASStackLayoutAlignSelf alignSelf;
|
||||
|
||||
/**
|
||||
* @abstract Used for baseline alignment. The distance from the top of the object to its baseline.
|
||||
*/
|
||||
@property (nonatomic, readwrite) CGFloat ascender;
|
||||
@property (nonatomic) CGFloat ascender;
|
||||
|
||||
/**
|
||||
* @abstract Used for baseline alignment. The distance from the baseline of the object to its bottom.
|
||||
*/
|
||||
@property (nonatomic, readwrite) CGFloat descender;
|
||||
@property (nonatomic) CGFloat descender;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@ -47,33 +47,33 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
Specifies the direction children are stacked in. If horizontalAlignment and verticalAlignment were set,
|
||||
they will be resolved again, causing justifyContent and alignItems to be updated accordingly
|
||||
*/
|
||||
@property (nonatomic, assign) ASStackLayoutDirection direction;
|
||||
@property (nonatomic) ASStackLayoutDirection direction;
|
||||
/** The amount of space between each child. */
|
||||
@property (nonatomic, assign) CGFloat spacing;
|
||||
@property (nonatomic) CGFloat spacing;
|
||||
/**
|
||||
Specifies how children are aligned horizontally. Depends on the stack direction, setting the alignment causes either
|
||||
justifyContent or alignItems to be updated. The alignment will remain valid after future direction changes.
|
||||
Thus, it is preferred to those properties
|
||||
*/
|
||||
@property (nonatomic, assign) ASHorizontalAlignment horizontalAlignment;
|
||||
@property (nonatomic) ASHorizontalAlignment horizontalAlignment;
|
||||
/**
|
||||
Specifies how children are aligned vertically. Depends on the stack direction, setting the alignment causes either
|
||||
justifyContent or alignItems to be updated. The alignment will remain valid after future direction changes.
|
||||
Thus, it is preferred to those properties
|
||||
*/
|
||||
@property (nonatomic, assign) ASVerticalAlignment verticalAlignment;
|
||||
@property (nonatomic) ASVerticalAlignment verticalAlignment;
|
||||
/** The amount of space between each child. Defaults to ASStackLayoutJustifyContentStart */
|
||||
@property (nonatomic, assign) ASStackLayoutJustifyContent justifyContent;
|
||||
@property (nonatomic) ASStackLayoutJustifyContent justifyContent;
|
||||
/** Orientation of children along cross axis. Defaults to ASStackLayoutAlignItemsStretch */
|
||||
@property (nonatomic, assign) ASStackLayoutAlignItems alignItems;
|
||||
@property (nonatomic) ASStackLayoutAlignItems alignItems;
|
||||
/** Whether children are stacked into a single or multiple lines. Defaults to single line (ASStackLayoutFlexWrapNoWrap) */
|
||||
@property (nonatomic, assign) ASStackLayoutFlexWrap flexWrap;
|
||||
@property (nonatomic) ASStackLayoutFlexWrap flexWrap;
|
||||
/** Orientation of lines along cross axis if there are multiple lines. Defaults to ASStackLayoutAlignContentStart */
|
||||
@property (nonatomic, assign) ASStackLayoutAlignContent alignContent;
|
||||
@property (nonatomic) ASStackLayoutAlignContent alignContent;
|
||||
/** If the stack spreads on multiple lines using flexWrap, the amount of space between lines. */
|
||||
@property (nonatomic, assign) CGFloat lineSpacing;
|
||||
@property (nonatomic) CGFloat lineSpacing;
|
||||
/** Whether this stack can dispatch to other threads, regardless of which thread it's running on */
|
||||
@property (nonatomic, assign, getter=isConcurrent) BOOL concurrent;
|
||||
@property (nonatomic, getter=isConcurrent) BOOL concurrent;
|
||||
|
||||
- (instancetype)init;
|
||||
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
#import <AsyncDisplayKit/ASLayoutSpec.h>
|
||||
|
||||
@interface ASYogaLayoutSpec : ASLayoutSpec
|
||||
@property (nonatomic, strong, nonnull) ASDisplayNode *rootNode;
|
||||
@property (nonatomic, nonnull) ASDisplayNode *rootNode;
|
||||
@end
|
||||
|
||||
#endif /* YOGA */
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
+ (ASBasicImageDownloaderContext *)contextForURL:(NSURL *)URL;
|
||||
|
||||
@property (nonatomic, strong, readonly) NSURL *URL;
|
||||
@property (nonatomic, readonly) NSURL *URL;
|
||||
@property (nonatomic, weak) NSURLSessionTask *sessionTask;
|
||||
|
||||
- (BOOL)isCancelled;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user