Skip to content

Commit

Permalink
Go crazy
Browse files Browse the repository at this point in the history
  • Loading branch information
Adlai Holler committed May 24, 2018
1 parent dda3cd2 commit 878c8e1
Show file tree
Hide file tree
Showing 135 changed files with 789 additions and 780 deletions.
18 changes: 9 additions & 9 deletions Source/ASButtonNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,41 +34,41 @@ typedef NS_ENUM(NSInteger, ASButtonNodeImageAlignment) {

@interface ASButtonNode : ASControlNode

@property (atomic, readonly) ASTextNode * titleNode;
@property (atomic, readonly) ASImageNode * imageNode;
@property (atomic, 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 (atomic) 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 (atomic) BOOL laysOutHorizontally;
@property BOOL laysOutHorizontally;

/** Horizontally align content (text or image).
Defaults to ASHorizontalAlignmentMiddle.
*/
@property (atomic) ASHorizontalAlignment contentHorizontalAlignment;
@property ASHorizontalAlignment contentHorizontalAlignment;

/** Vertically align content (text or image).
Defaults to ASVerticalAlignmentCenter.
*/
@property (atomic) ASVerticalAlignment contentVerticalAlignment;
@property ASVerticalAlignment contentVerticalAlignment;

/**
* @discussion The insets used around the title and image node
*/
@property (atomic) 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 (atomic) ASButtonNodeImageAlignment imageAlignment;
@property ASButtonNodeImageAlignment imageAlignment;

/**
* Returns the styled title associated with the specified state.
Expand Down
34 changes: 17 additions & 17 deletions Source/ASCellNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 (atomic) 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 (nullable, atomic, copy, readonly) NSString *supplementaryElementKind;
@property (nullable, copy, readonly) NSString *supplementaryElementKind;

/*
* The layout attributes currently assigned to this node, if any.
Expand All @@ -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 (nullable, atomic, copy, readonly) 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 (atomic, 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 (atomic, 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 (nullable, atomic, copy, readonly) 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.
Expand All @@ -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 (nullable, atomic) id nodeModel;
@property (nullable) id nodeModel;

/**
* Asks the node whether it can be updated to the given node model.
Expand All @@ -142,7 +142,7 @@ typedef NS_ENUM(NSUInteger, ASCellNodeVisibilityEvent) {
/**
* The table- or collection-node that this cell is a member of, if any.
*/
@property (nullable, atomic, weak, readonly) 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
Expand Down Expand Up @@ -188,30 +188,30 @@ typedef NS_ENUM(NSUInteger, ASCellNodeVisibilityEvent) {
* @default UITableViewCellSelectionStyleDefault
* ASTableView uses these properties when configuring UITableViewCells that host ASCellNodes.
*/
@property (atomic) 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 (atomic) 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 (nullable, atomic) 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 (atomic) UITableViewCellAccessoryType accessoryType;
@property UITableViewCellAccessoryType accessoryType;

/* @abstract The inset of the cell separator line
* ASTableView uses these properties when configuring UITableViewCells that host ASCellNodes.
*/
@property (atomic) UIEdgeInsets separatorInset;
@property UIEdgeInsets separatorInset;

@end

Expand Down Expand Up @@ -239,22 +239,22 @@ typedef NS_ENUM(NSUInteger, ASCellNodeVisibilityEvent) {
/**
* Text to display.
*/
@property (nullable, atomic, 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 (atomic, copy) NSDictionary<NSAttributedStringKey, id> *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 (atomic) UIEdgeInsets textInsets;
@property UIEdgeInsets textInsets;

/**
* The text node used by this cell node.
*/
@property (atomic, readonly) ASTextNode *textNode;
@property (readonly) ASTextNode *textNode;

@end

Expand Down
6 changes: 3 additions & 3 deletions Source/ASCollectionNode+Beta.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@ NS_ASSUME_NONNULL_BEGIN
*
* @default [ASCollectionView class] is used whenever this property is unset or nil.
*/
@property (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 (nonatomic, readonly) ASElementMap *visibleElements;

@property (atomic, 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,
Expand Down
8 changes: 4 additions & 4 deletions Source/ASCollectionNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ NS_ASSUME_NONNULL_BEGIN
*
* @return view The corresponding ASCollectionView.
*/
@property (atomic, readonly) ASCollectionView *view;
@property (readonly) ASCollectionView *view;

/**
* The object that acts as the asynchronous delegate of the collection view
Expand All @@ -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 (nullable, atomic, weak) id <ASCollectionDelegate> delegate;
@property (nullable, weak) id <ASCollectionDelegate> delegate;

/**
* The object that acts as the asynchronous data source of the collection view
Expand All @@ -81,7 +81,7 @@ 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 (nullable, atomic, weak) id <ASCollectionDataSource> dataSource;
@property (nullable, weak) id <ASCollectionDataSource> dataSource;

/**
* The number of screens left to scroll before the delegate -collectionNode:beginBatchFetchingWithContext: is called.
Expand Down Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions Source/ASCollectionView.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion Source/ASControlNode+Subclasses.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ NS_ASSUME_NONNULL_BEGIN
/**
@abstract Settable version of highlighted property.
*/
@property (atomic, getter=isHighlighted) BOOL highlighted;
@property (getter=isHighlighted) BOOL highlighted;

@end

Expand Down
10 changes: 5 additions & 5 deletions Source/ASControlNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 (atomic, 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 (atomic, 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 (atomic, 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 (atomic, readonly, 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 (atomic, readonly, getter=isTouchInside) BOOL touchInside;
@property (readonly, getter=isTouchInside) BOOL touchInside;

#pragma mark - Action Messages
/**
Expand Down
4 changes: 2 additions & 2 deletions Source/ASControlNode.mm
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ @interface ASControlNode ()
}

// Read-write overrides.
@property (atomic, getter=isTracking) BOOL tracking;
@property (atomic, 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.
Expand Down
38 changes: 19 additions & 19 deletions Source/ASDisplayNode+Beta.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,22 +75,22 @@ 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 (nullable, atomic) ASDisplayNodeContextModifier willDisplayNodeContentWithRenderingContext;
@property (nullable) ASDisplayNodeContextModifier willDisplayNodeContentWithRenderingContext;

/**
* @abstract allow modification of a context after the node's content is drawn
*/
@property (nullable, atomic) ASDisplayNodeContextModifier didDisplayNodeContentWithRenderingContext;
@property (nullable) ASDisplayNodeContextModifier didDisplayNodeContentWithRenderingContext;

/**
* @abstract A bitmask representing which actions (layout spec, layout generation) should be measured.
*/
@property (atomic) ASDisplayNodePerformanceMeasurementOptions measurementOptions;
@property ASDisplayNodePerformanceMeasurementOptions measurementOptions;

/**
* @abstract A simple struct representing performance measurements collected.
*/
@property (atomic, readonly) ASDisplayNodePerformanceMeasurements performanceMeasurements;
@property (readonly) ASDisplayNodePerformanceMeasurements performanceMeasurements;

#if ASEVENTLOG_ENABLE
/*
Expand All @@ -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 (atomic) 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
Expand Down Expand Up @@ -180,7 +180,7 @@ extern void ASDisplayNodePerformBlockOnEveryYogaChild(ASDisplayNode * _Nullable

- (void)semanticContentAttributeDidChange:(UISemanticContentAttribute)attribute;

@property (atomic) BOOL yogaLayoutInProgress;
@property BOOL yogaLayoutInProgress;
@property (nullable, nonatomic) ASLayout *yogaCalculatedLayout;

// These methods are intended to be used internally to Texture, and should not be called directly.
Expand All @@ -195,19 +195,19 @@ extern void ASDisplayNodePerformBlockOnEveryYogaChild(ASDisplayNode * _Nullable
- (YGNodeRef)yogaNodeCreateIfNeeded;
- (void)destroyYogaNode;

@property (atomic, readonly) YGNodeRef yogaNode;

@property (atomic) ASStackLayoutDirection flexDirection;
@property (atomic) YGDirection direction;
@property (atomic) ASStackLayoutJustifyContent justifyContent;
@property (atomic) ASStackLayoutAlignItems alignItems;
@property (atomic) YGPositionType positionType;
@property (atomic) ASEdgeInsets position;
@property (atomic) ASEdgeInsets margin;
@property (atomic) ASEdgeInsets padding;
@property (atomic) ASEdgeInsets border;
@property (atomic) CGFloat aspectRatio;
@property (atomic) YGWrap flexWrap;
@property (readonly) YGNodeRef yogaNode;

@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

Expand Down
Loading

0 comments on commit 878c8e1

Please sign in to comment.