diff --git a/AsyncDisplayKit/ASButtonNode.mm b/AsyncDisplayKit/ASButtonNode.mm index 89ffac944d..d56f459a50 100644 --- a/AsyncDisplayKit/ASButtonNode.mm +++ b/AsyncDisplayKit/ASButtonNode.mm @@ -271,8 +271,8 @@ - (void)setTitle:(NSString *)title withFont:(UIFont *)font withColor:(UIColor *)color forState:(ASControlState)state { NSDictionary *attributes = @{ - NSFontAttributeName: font ? font :[UIFont systemFontOfSize:[UIFont buttonFontSize]], - NSForegroundColorAttributeName : color ? color : [UIColor blackColor] + NSFontAttributeName: font ?: [UIFont systemFontOfSize:[UIFont buttonFontSize]], + NSForegroundColorAttributeName : color ?: [UIColor blackColor] }; NSAttributedString *string = [[NSAttributedString alloc] initWithString:title diff --git a/AsyncDisplayKit/ASControlNode.mm b/AsyncDisplayKit/ASControlNode.mm index dde8a9e00f..54ac169f0d 100644 --- a/AsyncDisplayKit/ASControlNode.mm +++ b/AsyncDisplayKit/ASControlNode.mm @@ -257,13 +257,13 @@ static BOOL _enableHitTestDebug = NO; { // Do we already have an event table for this control event? id eventKey = _ASControlNodeEventKeyForControlEvent(controlEvent); - NSMapTable *eventDispatchTable = [_controlEventDispatchTable objectForKey:eventKey]; + NSMapTable *eventDispatchTable = _controlEventDispatchTable[eventKey]; // Create it if necessary. if (!eventDispatchTable) { // Create the dispatch table for this event. eventDispatchTable = [NSMapTable weakToStrongObjectsMapTable]; - [_controlEventDispatchTable setObject:eventDispatchTable forKey:eventKey]; + _controlEventDispatchTable[eventKey] = eventDispatchTable; } // Have we seen this target before for this event? @@ -291,7 +291,7 @@ static BOOL _enableHitTestDebug = NO; ASDN::MutexLocker l(_controlLock); // Grab the event dispatch table for this event. - NSMapTable *eventDispatchTable = [_controlEventDispatchTable objectForKey:_ASControlNodeEventKeyForControlEvent(controlEvent)]; + NSMapTable *eventDispatchTable = _controlEventDispatchTable[_ASControlNodeEventKeyForControlEvent(controlEvent)]; if (!eventDispatchTable) return nil; @@ -328,7 +328,7 @@ static BOOL _enableHitTestDebug = NO; { // Grab the dispatch table for this event (if we have it). id eventKey = _ASControlNodeEventKeyForControlEvent(controlEvent); - NSMapTable *eventDispatchTable = [_controlEventDispatchTable objectForKey:eventKey]; + NSMapTable *eventDispatchTable = _controlEventDispatchTable[eventKey]; if (!eventDispatchTable) return; @@ -381,7 +381,7 @@ static BOOL _enableHitTestDebug = NO; (ASControlNodeEvent controlEvent) { // Use a copy to itereate, the action perform could call remove causing a mutation crash. - NSMapTable *eventDispatchTable = [[_controlEventDispatchTable objectForKey:_ASControlNodeEventKeyForControlEvent(controlEvent)] copy]; + NSMapTable *eventDispatchTable = [_controlEventDispatchTable[_ASControlNodeEventKeyForControlEvent(controlEvent)] copy]; // For each target interested in this event... for (id target in eventDispatchTable) @@ -413,7 +413,7 @@ static BOOL _enableHitTestDebug = NO; id _ASControlNodeEventKeyForControlEvent(ASControlNodeEvent controlEvent) { - return [NSNumber numberWithInteger:controlEvent]; + return @(controlEvent); } void _ASEnumerateControlEventsIncludedInMaskWithBlock(ASControlNodeEvent mask, void (^block)(ASControlNodeEvent anEvent)) diff --git a/AsyncDisplayKit/ASDisplayNode.h b/AsyncDisplayKit/ASDisplayNode.h index 2f67dc170c..96530419b4 100644 --- a/AsyncDisplayKit/ASDisplayNode.h +++ b/AsyncDisplayKit/ASDisplayNode.h @@ -177,7 +177,7 @@ NS_ASSUME_NONNULL_BEGIN * @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, retain) UIView *view; +@property (nonatomic, readonly, strong) UIView *view; /** * @abstract Returns whether a node's backing view or layer is loaded. @@ -202,7 +202,7 @@ NS_ASSUME_NONNULL_BEGIN * @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, retain) CALayer * _Nonnull layer; +@property (nonatomic, readonly, strong) CALayer * _Nonnull layer; /** * @abstract Returns the Interface State of the node. @@ -351,7 +351,7 @@ NS_ASSUME_NONNULL_BEGIN /** * @abstract The receiver's immediate subnodes. */ -@property (nonatomic, readonly, retain) NSArray *subnodes; +@property (nonatomic, readonly, strong) NSArray *subnodes; /** * @abstract The receiver's supernode. @@ -617,7 +617,7 @@ NS_ASSUME_NONNULL_END */ - (void)setNeedsLayout; -@property (atomic, retain, nullable) id contents; // default=nil +@property (atomic, strong, nullable) id contents; // default=nil @property (atomic, assign) BOOL clipsToBounds; // default==NO @property (atomic, getter=isOpaque) BOOL opaque; // default==YES @@ -645,9 +645,9 @@ NS_ASSUME_NONNULL_END * @discussion In contrast to UIView, setting a transparent color will not set opaque = NO. * This only affects nodes that implement +drawRect like ASTextNode. */ -@property (atomic, retain, nullable) UIColor *backgroundColor; // default=nil +@property (atomic, strong, nullable) UIColor *backgroundColor; // default=nil -@property (atomic, retain, null_resettable) UIColor *tintColor; // default=Blue +@property (atomic, strong, null_resettable) UIColor *tintColor; // default=Blue - (void)tintColorDidChange; // Notifies the node when the tintColor has changed. /** @@ -697,7 +697,7 @@ NS_ASSUME_NONNULL_END @property (nullable, atomic, copy) NSString *accessibilityValue; @property (atomic, assign) UIAccessibilityTraits accessibilityTraits; @property (atomic, assign) CGRect accessibilityFrame; -@property (nullable, atomic, retain) NSString *accessibilityLanguage; +@property (nullable, atomic, strong) NSString *accessibilityLanguage; @property (atomic, assign) BOOL accessibilityElementsHidden; @property (atomic, assign) BOOL accessibilityViewIsModal; @property (atomic, assign) BOOL shouldGroupAccessibilityChildren; diff --git a/AsyncDisplayKit/ASDisplayNode.mm b/AsyncDisplayKit/ASDisplayNode.mm index d16479a5d5..322f443182 100644 --- a/AsyncDisplayKit/ASDisplayNode.mm +++ b/AsyncDisplayKit/ASDisplayNode.mm @@ -224,7 +224,7 @@ static ASDisplayNodeMethodOverrides GetASDisplayNodeMethodOverrides(Class c) if (isQueueDrained) { [[NSNotificationCenter defaultCenter] postNotificationName:ASRenderingEngineDidDisplayScheduledNodesNotification object:nil - userInfo:@{ASRenderingEngineDidDisplayNodesScheduledBeforeTimestamp: [NSNumber numberWithDouble:timestamp]}]; + userInfo:@{ASRenderingEngineDidDisplayNodesScheduledBeforeTimestamp: @(timestamp)}]; } }]; }); @@ -1061,7 +1061,7 @@ static inline CATransform3D _calculateTransformFromReferenceToTarget(ASDisplayNo { ASDisplayNodeAssertThreadAffinity(self); // Get root node of the accessible node hierarchy, if node not specified - node = node ? node : ASDisplayNodeUltimateParentOfNode(self); + node = node ?: ASDisplayNodeUltimateParentOfNode(self); // Calculate transform to map points between coordinate spaces CATransform3D nodeTransform = _calculateTransformFromReferenceToTarget(node, self); @@ -1076,7 +1076,7 @@ static inline CATransform3D _calculateTransformFromReferenceToTarget(ASDisplayNo { ASDisplayNodeAssertThreadAffinity(self); // Get root node of the accessible node hierarchy, if node not specified - node = node ? node : ASDisplayNodeUltimateParentOfNode(self); + node = node ?: ASDisplayNodeUltimateParentOfNode(self); // Calculate transform to map points between coordinate spaces CATransform3D nodeTransform = _calculateTransformFromReferenceToTarget(self, node); @@ -1091,7 +1091,7 @@ static inline CATransform3D _calculateTransformFromReferenceToTarget(ASDisplayNo { ASDisplayNodeAssertThreadAffinity(self); // Get root node of the accessible node hierarchy, if node not specified - node = node ? node : ASDisplayNodeUltimateParentOfNode(self); + node = node ?: ASDisplayNodeUltimateParentOfNode(self); // Calculate transform to map points between coordinate spaces CATransform3D nodeTransform = _calculateTransformFromReferenceToTarget(node, self); @@ -1106,7 +1106,7 @@ static inline CATransform3D _calculateTransformFromReferenceToTarget(ASDisplayNo { ASDisplayNodeAssertThreadAffinity(self); // Get root node of the accessible node hierarchy, if node not specified - node = node ? node : ASDisplayNodeUltimateParentOfNode(self); + node = node ?: ASDisplayNodeUltimateParentOfNode(self); // Calculate transform to map points between coordinate spaces CATransform3D nodeTransform = _calculateTransformFromReferenceToTarget(self, node); @@ -2085,11 +2085,7 @@ void recursivelyTriggerDisplayForLayer(CALayer *layer, BOOL shouldBlock) BOOL wasVisible = ASInterfaceStateIncludesVisible(oldState); if (nowVisible != wasVisible) { - if (nowVisible) { - [self visibilityDidChange:YES]; - } else { - [self visibilityDidChange:NO]; - } + [self visibilityDidChange:nowVisible]; } [self interfaceStateDidChange:newState fromState:oldState]; @@ -2513,7 +2509,7 @@ static const char *ASDisplayNodeDrawingPriorityKey = "ASDrawingPriority"; objc_setAssociatedObject(self, ASDisplayNodeDrawingPriorityKey, nil, OBJC_ASSOCIATION_ASSIGN); } else { _flags.hasCustomDrawingPriority = YES; - objc_setAssociatedObject(self, ASDisplayNodeDrawingPriorityKey, [NSNumber numberWithInteger:drawingPriority], OBJC_ASSOCIATION_RETAIN); + objc_setAssociatedObject(self, ASDisplayNodeDrawingPriorityKey, @(drawingPriority), OBJC_ASSOCIATION_RETAIN); } } diff --git a/AsyncDisplayKit/ASEqualityHashHelpers.mm b/AsyncDisplayKit/ASEqualityHashHelpers.mm index ca159fc980..decce0064c 100644 --- a/AsyncDisplayKit/ASEqualityHashHelpers.mm +++ b/AsyncDisplayKit/ASEqualityHashHelpers.mm @@ -10,11 +10,6 @@ #import "ASEqualityHashHelpers.h" -#import -#import -#import -#import - NSUInteger ASIntegerArrayHash(const NSUInteger *subhashes, NSUInteger count) { uint64_t result = subhashes[0]; diff --git a/AsyncDisplayKit/ASImageNode.h b/AsyncDisplayKit/ASImageNode.h index b2298752e5..14c819cd4d 100644 --- a/AsyncDisplayKit/ASImageNode.h +++ b/AsyncDisplayKit/ASImageNode.h @@ -33,7 +33,7 @@ typedef UIImage * _Nullable (^asimagenode_modification_block_t)(UIImage *image); * the layer's contentsCenter property. Non-stretchable images work too, of * course. */ -@property (nullable, atomic, retain) UIImage *image; +@property (nullable, atomic, strong) UIImage *image; /** @abstract The placeholder color. diff --git a/AsyncDisplayKit/ASImageNode.mm b/AsyncDisplayKit/ASImageNode.mm index 94891a62ed..66fa1fdfc5 100644 --- a/AsyncDisplayKit/ASImageNode.mm +++ b/AsyncDisplayKit/ASImageNode.mm @@ -28,7 +28,7 @@ @property (nonatomic, assign) BOOL opaque; @property (nonatomic, assign) CGRect bounds; @property (nonatomic, assign) CGFloat contentsScale; -@property (nonatomic, retain) UIColor *backgroundColor; +@property (nonatomic, strong) UIColor *backgroundColor; @property (nonatomic, assign) UIViewContentMode contentMode; @end diff --git a/AsyncDisplayKit/ASRunLoopQueue.mm b/AsyncDisplayKit/ASRunLoopQueue.mm index 7de377feab..2eb3420e18 100644 --- a/AsyncDisplayKit/ASRunLoopQueue.mm +++ b/AsyncDisplayKit/ASRunLoopQueue.mm @@ -53,7 +53,6 @@ { std::deque itemsToProcess = std::deque(); BOOL isQueueDrained = NO; - CFAbsoluteTime timestamp = 0; { ASDN::MutexLocker l(_internalQueueLock); @@ -72,7 +71,6 @@ if (_internalQueue.empty()) { isQueueDrained = YES; - timestamp = CFAbsoluteTimeGetCurrent(); } } diff --git a/AsyncDisplayKit/ASTableView.mm b/AsyncDisplayKit/ASTableView.mm index 695b1e8d7e..f6ad8cc7df 100644 --- a/AsyncDisplayKit/ASTableView.mm +++ b/AsyncDisplayKit/ASTableView.mm @@ -118,13 +118,13 @@ static NSString * const kCellReuseIdentifier = @"_ASTableViewCell"; } @property (atomic, assign) BOOL asyncDataSourceLocked; -@property (nonatomic, retain, readwrite) ASDataController *dataController; +@property (nonatomic, strong, readwrite) ASDataController *dataController; // Used only when ASTableView is created directly rather than through ASTableNode. // We create a node so that logic related to appearance, memory management, etc can be located there // for both the node-based and view-based version of the table. // This also permits sharing logic with ASCollectionNode, as the superclass is not UIKit-controlled. -@property (nonatomic, retain) ASTableNode *strongTableNode; +@property (nonatomic, strong) ASTableNode *strongTableNode; // Always set, whether ASCollectionView is created directly or via ASCollectionNode. @property (nonatomic, weak) ASTableNode *tableNode; diff --git a/AsyncDisplayKit/ASTableViewInternal.h b/AsyncDisplayKit/ASTableViewInternal.h index c6e444dfda..3c1eb2f0c0 100644 --- a/AsyncDisplayKit/ASTableViewInternal.h +++ b/AsyncDisplayKit/ASTableViewInternal.h @@ -12,7 +12,7 @@ @interface ASTableView (Internal) -@property (nonatomic, retain, readonly) ASDataController *dataController; +@property (nonatomic, strong, readonly) ASDataController *dataController; @property (nonatomic, weak, readwrite) ASTableNode *tableNode; @property (nonatomic, strong, readonly) ASRangeController *rangeController; diff --git a/AsyncDisplayKit/ASTextNode.mm b/AsyncDisplayKit/ASTextNode.mm index daa1a2aa20..869953cbfe 100644 --- a/AsyncDisplayKit/ASTextNode.mm +++ b/AsyncDisplayKit/ASTextNode.mm @@ -475,7 +475,6 @@ static NSArray *DefaultLinkAttributeNames = @[ NSLinkAttributeName ]; // Final output vars __block id linkAttributeValue = nil; - __block NSString *linkAttributeName = nil; __block BOOL inTruncationMessage = NO; [renderer enumerateTextIndexesAtPosition:point usingBlock:^(NSUInteger characterIndex, CGRect glyphBoundingRect, BOOL *stop) { @@ -544,7 +543,6 @@ static NSArray *DefaultLinkAttributeNames = @[ NSLinkAttributeName ]; // Set the values for the next iteration linkAttributeValue = value; - linkAttributeName = name; break; } diff --git a/AsyncDisplayKit/ASVideoNode.mm b/AsyncDisplayKit/ASVideoNode.mm index 15438fa3c8..34ac29bfdb 100644 --- a/AsyncDisplayKit/ASVideoNode.mm +++ b/AsyncDisplayKit/ASVideoNode.mm @@ -80,14 +80,14 @@ - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { - if ([[change objectForKey:@"new"] integerValue] == AVPlayerItemStatusReadyToPlay) { + if ([change[@"new"] integerValue] == AVPlayerItemStatusReadyToPlay) { if ([self.subnodes containsObject:_spinner]) { [_spinner removeFromSupernode]; _spinner = nil; } } - if ([[change objectForKey:@"new"] integerValue] == AVPlayerItemStatusFailed) { + if ([change[@"new"] integerValue] == AVPlayerItemStatusFailed) { } } diff --git a/AsyncDisplayKit/Details/ASCollectionViewFlowLayoutInspector.m b/AsyncDisplayKit/Details/ASCollectionViewFlowLayoutInspector.m index 6168730878..3fe377f3a3 100644 --- a/AsyncDisplayKit/Details/ASCollectionViewFlowLayoutInspector.m +++ b/AsyncDisplayKit/Details/ASCollectionViewFlowLayoutInspector.m @@ -104,11 +104,7 @@ - (BOOL)layoutHasSupplementaryViewOfKind:(NSString *)kind inSection:(NSUInteger)section collectionView:(ASCollectionView *)collectionView { CGSize size = [self sizeForSupplementaryViewOfKind:kind inSection:section collectionView:collectionView]; - if ([self usedLayoutValueForSize:size] > 0) { - return YES; - } else { - return NO; - } + return [self usedLayoutValueForSize:size] > 0; } - (CGFloat)usedLayoutValueForSize:(CGSize)size diff --git a/AsyncDisplayKit/Details/ASDataController.mm b/AsyncDisplayKit/Details/ASDataController.mm index c485144d46..8a0ad6403f 100644 --- a/AsyncDisplayKit/Details/ASDataController.mm +++ b/AsyncDisplayKit/Details/ASDataController.mm @@ -876,12 +876,12 @@ static void *kASSizingQueueContext = &kASSizingQueueContext; [_editingTransactionQueue addOperationWithBlock:^{ LOG(@"Edit Transaction - moveRow: %@ > %@", indexPath, newIndexPath); - NSArray *nodes = ASFindElementsInMultidimensionalArrayAtIndexPaths(_editingNodes[ASDataControllerRowNodeKind], [NSArray arrayWithObject:indexPath]); - NSArray *indexPaths = [NSArray arrayWithObject:indexPath]; + NSArray *nodes = ASFindElementsInMultidimensionalArrayAtIndexPaths(_editingNodes[ASDataControllerRowNodeKind], @[indexPath]); + NSArray *indexPaths = @[indexPath]; [self _deleteNodesAtIndexPaths:indexPaths withAnimationOptions:animationOptions]; // Don't re-calculate size for moving - NSArray *newIndexPaths = [NSArray arrayWithObject:newIndexPath]; + NSArray *newIndexPaths = @[newIndexPath]; [self _insertNodes:nodes atIndexPaths:newIndexPaths withAnimationOptions:animationOptions]; }]; }]; @@ -967,7 +967,7 @@ static void *kASSizingQueueContext = &kASSizingQueueContext; - (NSArray *)completedNodes { ASDisplayNodeAssertMainThread(); - return _externalCompletedNodes != nil ? _externalCompletedNodes : _completedNodes[ASDataControllerRowNodeKind]; + return _externalCompletedNodes ?: _completedNodes[ASDataControllerRowNodeKind]; } #pragma mark - Dealloc diff --git a/AsyncDisplayKit/Details/ASMainSerialQueue.mm b/AsyncDisplayKit/Details/ASMainSerialQueue.mm index 10fb29107e..d46a02a1ad 100644 --- a/AsyncDisplayKit/Details/ASMainSerialQueue.mm +++ b/AsyncDisplayKit/Details/ASMainSerialQueue.mm @@ -45,7 +45,7 @@ ASDN::MutexLocker l(_serialQueueLock); dispatch_block_t block; if (_blocks.count > 0) { - block = [_blocks objectAtIndex:0]; + block = _blocks[0]; [_blocks removeObjectAtIndex:0]; } else { break; diff --git a/AsyncDisplayKit/Details/ASRangeController.mm b/AsyncDisplayKit/Details/ASRangeController.mm index d89d117af4..bbec2630d5 100644 --- a/AsyncDisplayKit/Details/ASRangeController.mm +++ b/AsyncDisplayKit/Details/ASRangeController.mm @@ -286,13 +286,13 @@ static UIApplicationState __ApplicationState = UIApplicationStateActive; if (section != currentSectionIndex) { // Often we'll be dealing with indexPaths in the same section, but the set isn't sorted and we may even bounce // between the same ones. Still, this saves dozens of method calls to access the inner array and count. - currentSectionNodes = [allNodes objectAtIndex:section]; + currentSectionNodes = allNodes[section]; numberOfNodesInSection = [currentSectionNodes count]; currentSectionIndex = section; } if (row < numberOfNodesInSection) { - ASDisplayNode *node = [currentSectionNodes objectAtIndex:row]; + ASDisplayNode *node = currentSectionNodes[row]; ASDisplayNodeAssert(node.hierarchyState & ASHierarchyStateRangeManaged, @"All nodes reaching this point should be range-managed, or interfaceState may be incorrectly reset."); // Skip the many method calls of the recursive operation if the top level cell node already has the right interfaceState. @@ -345,7 +345,7 @@ static UIApplicationState __ApplicationState = UIApplicationStateActive; - (void)scheduledNodesDidDisplay:(NSNotification *)notification { - CFAbsoluteTime notificationTimestamp = ((NSNumber *)[notification.userInfo objectForKey:ASRenderingEngineDidDisplayNodesScheduledBeforeTimestamp]).doubleValue; + CFAbsoluteTime notificationTimestamp = ((NSNumber *) notification.userInfo[ASRenderingEngineDidDisplayNodesScheduledBeforeTimestamp]).doubleValue; if (_pendingDisplayNodesTimestamp < notificationTimestamp) { // The rendering engine has processed all the nodes this range controller scheduled. Let's schedule a range update [[NSNotificationCenter defaultCenter] removeObserver:self name:ASRenderingEngineDidDisplayScheduledNodesNotification object:nil]; diff --git a/AsyncDisplayKit/Details/Transactions/_ASAsyncTransaction.mm b/AsyncDisplayKit/Details/Transactions/_ASAsyncTransaction.mm index 66a4fb0df9..6b67b8b770 100644 --- a/AsyncDisplayKit/Details/Transactions/_ASAsyncTransaction.mm +++ b/AsyncDisplayKit/Details/Transactions/_ASAsyncTransaction.mm @@ -18,7 +18,7 @@ NSInteger const ASDefaultTransactionPriority = 0; @interface ASDisplayNodeAsyncTransactionOperation : NSObject - (id)initWithOperationCompletionBlock:(asyncdisplaykit_async_transaction_operation_completion_block_t)operationCompletionBlock; @property (nonatomic, copy) asyncdisplaykit_async_transaction_operation_completion_block_t operationCompletionBlock; -@property (atomic, retain) id value; // set on bg queue by the operation block +@property (atomic, strong) id value; // set on bg queue by the operation block @end @implementation ASDisplayNodeAsyncTransactionOperation @@ -236,7 +236,7 @@ void ASAsyncTransactionQueue::GroupImpl::schedule(NSInteger priority, dispatch_q operation._block(); } operation._group->leave(); - operation._block = 0; // the block must be freed while mutex is unlocked + operation._block = nil; // the block must be freed while mutex is unlocked } } --entry._threadCount; diff --git a/AsyncDisplayKit/Details/Transactions/_ASAsyncTransactionContainer+Private.h b/AsyncDisplayKit/Details/Transactions/_ASAsyncTransactionContainer+Private.h index 32421c2543..690ce93cd6 100644 --- a/AsyncDisplayKit/Details/Transactions/_ASAsyncTransactionContainer+Private.h +++ b/AsyncDisplayKit/Details/Transactions/_ASAsyncTransactionContainer+Private.h @@ -10,8 +10,8 @@ @interface CALayer (ASAsyncTransactionContainerTransactions) -@property (nonatomic, retain, setter=asyncdisplaykit_setAsyncLayerTransactions:) NSHashTable *asyncdisplaykit_asyncLayerTransactions; -@property (nonatomic, retain, setter=asyncdisplaykit_setCurrentAsyncLayerTransaction:) _ASAsyncTransaction *asyncdisplaykit_currentAsyncLayerTransaction; +@property (nonatomic, strong, setter=asyncdisplaykit_setAsyncLayerTransactions:) NSHashTable *asyncdisplaykit_asyncLayerTransactions; +@property (nonatomic, strong, setter=asyncdisplaykit_setCurrentAsyncLayerTransaction:) _ASAsyncTransaction *asyncdisplaykit_currentAsyncLayerTransaction; - (void)asyncdisplaykit_asyncTransactionContainerWillBeginTransaction:(_ASAsyncTransaction *)transaction; - (void)asyncdisplaykit_asyncTransactionContainerDidCompleteTransaction:(_ASAsyncTransaction *)transaction; diff --git a/AsyncDisplayKit/Details/Transactions/_ASAsyncTransactionContainer.h b/AsyncDisplayKit/Details/Transactions/_ASAsyncTransactionContainer.h index 628d461a39..9626418804 100644 --- a/AsyncDisplayKit/Details/Transactions/_ASAsyncTransactionContainer.h +++ b/AsyncDisplayKit/Details/Transactions/_ASAsyncTransactionContainer.h @@ -59,13 +59,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, retain) _ASAsyncTransaction *asyncdisplaykit_asyncTransaction; +@property (nonatomic, readonly, strong) _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, retain) CALayer *asyncdisplaykit_parentTransactionContainer; +@property (nonatomic, readonly, strong) CALayer *asyncdisplaykit_parentTransactionContainer; @end @interface UIView (ASDisplayNodeAsyncTransactionContainer) diff --git a/AsyncDisplayKit/Details/UIView+ASConvenience.h b/AsyncDisplayKit/Details/UIView+ASConvenience.h index d84f79923f..b10e8900b1 100644 --- a/AsyncDisplayKit/Details/UIView+ASConvenience.h +++ b/AsyncDisplayKit/Details/UIView+ASConvenience.h @@ -20,20 +20,20 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, assign) CGPoint position; @property (nonatomic, assign) CGFloat zPosition; @property (nonatomic, assign) CGPoint anchorPoint; -@property (nullable, nonatomic, retain) id contents; +@property (nullable, nonatomic, strong) id contents; @property (nonatomic, assign) CGFloat cornerRadius; @property (nonatomic, assign) CGFloat contentsScale; @property (nonatomic, assign) CATransform3D transform; @property (nonatomic, assign) CATransform3D sublayerTransform; @property (nonatomic, assign) BOOL needsDisplayOnBoundsChange; -@property (nonatomic, retain) __attribute__((NSObject)) CGColorRef shadowColor; +@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, retain) __attribute__((NSObject)) CGColorRef borderColor; -@property (nonatomic, retain) __attribute__((NSObject)) CGColorRef backgroundColor; +@property (nonatomic, strong) __attribute__((NSObject)) CGColorRef borderColor; +@property (nonatomic, strong) __attribute__((NSObject)) CGColorRef backgroundColor; @property (nonatomic, assign) BOOL allowsEdgeAntialiasing; @property (nonatomic, assign) unsigned int edgeAntialiasingMask; @@ -51,7 +51,7 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, getter=isHidden) BOOL hidden; @property (nonatomic, assign) BOOL autoresizesSubviews; @property (nonatomic, assign) UIViewAutoresizing autoresizingMask; -@property (nonatomic, retain, null_resettable) UIColor *tintColor; +@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 @@ -71,7 +71,7 @@ NS_ASSUME_NONNULL_BEGIN @property (atomic, copy) NSString *accessibilityValue; @property (atomic, assign) UIAccessibilityTraits accessibilityTraits; @property (atomic, assign) CGRect accessibilityFrame; - @property (atomic, retain) NSString *accessibilityLanguage; + @property (atomic, strong) NSString *accessibilityLanguage; @property (atomic, assign) BOOL accessibilityElementsHidden; @property (atomic, assign) BOOL accessibilityViewIsModal; @property (atomic, assign) BOOL shouldGroupAccessibilityChildren; diff --git a/AsyncDisplayKit/Details/_ASDisplayView.mm b/AsyncDisplayKit/Details/_ASDisplayView.mm index 1c117928e2..22477a0490 100644 --- a/AsyncDisplayKit/Details/_ASDisplayView.mm +++ b/AsyncDisplayKit/Details/_ASDisplayView.mm @@ -23,7 +23,7 @@ // 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, retain, readwrite) ASDisplayNode *keepalive_node; +@property (nonatomic, strong, readwrite) ASDisplayNode *keepalive_node; @end @implementation _ASDisplayView diff --git a/AsyncDisplayKit/Layout/ASDimension.mm b/AsyncDisplayKit/Layout/ASDimension.mm index 7715e3b07a..4c7fd0a42b 100644 --- a/AsyncDisplayKit/Layout/ASDimension.mm +++ b/AsyncDisplayKit/Layout/ASDimension.mm @@ -100,7 +100,7 @@ struct _Range { { CGFloat newMin = MAX(min, other.min); CGFloat newMax = MIN(max, other.max); - if (!(newMin > newMax)) { + if (newMin <= newMax) { return {newMin, newMax}; } else { // No intersection. If we're before the other range, return our max; otherwise our min. diff --git a/AsyncDisplayKit/Private/ASDisplayNodeInternal.h b/AsyncDisplayKit/Private/ASDisplayNodeInternal.h index e491aac0c6..d266edc85c 100644 --- a/AsyncDisplayKit/Private/ASDisplayNodeInternal.h +++ b/AsyncDisplayKit/Private/ASDisplayNodeInternal.h @@ -139,7 +139,7 @@ FOUNDATION_EXPORT NSString * const ASRenderingEngineDidDisplayNodesScheduledBefo + (void)scheduleNodeForRecursiveDisplay:(ASDisplayNode *)node; // The _ASDisplayLayer backing the node, if any. -@property (nonatomic, readonly, retain) _ASDisplayLayer *asyncLayer; +@property (nonatomic, readonly, strong) _ASDisplayLayer *asyncLayer; // Bitmask to check which methods an object overrides. @property (nonatomic, assign, readonly) ASDisplayNodeMethodOverrides methodOverrides; diff --git a/AsyncDisplayKit/TextKit/ASTextKitAttributes.h b/AsyncDisplayKit/TextKit/ASTextKitAttributes.h index b765deaca1..e18d615a3f 100755 --- a/AsyncDisplayKit/TextKit/ASTextKitAttributes.h +++ b/AsyncDisplayKit/TextKit/ASTextKitAttributes.h @@ -24,7 +24,7 @@ extern NSString *const ASTextKitEntityAttributeName; static inline BOOL _objectsEqual(id obj1, id obj2) { - return obj1 == obj2 ? YES : [obj1 isEqual:obj2]; + return obj1 == obj2 || [obj1 isEqual:obj2]; } /** diff --git a/Base/ASEqualityHelpers.h b/Base/ASEqualityHelpers.h index e4447aef0c..f6dd4de1b7 100644 --- a/Base/ASEqualityHelpers.h +++ b/Base/ASEqualityHelpers.h @@ -16,7 +16,5 @@ */ ASDISPLAYNODE_INLINE BOOL ASObjectIsEqual(id obj, id otherObj) { - if (obj == otherObj) - return YES; - return [obj isEqual:otherObj]; + return obj == otherObj || [obj isEqual:otherObj]; }