Skip to content
This repository was archived by the owner on Feb 2, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
814f725
Add nullability annotations for public API
Adlai-Holler Sep 16, 2015
262d65e
More updates
Adlai-Holler Sep 16, 2015
04690c0
Re-add nil tests
Adlai-Holler Sep 16, 2015
30ed0bd
Restore old ASCollectionNode init
Adlai-Holler Sep 16, 2015
a7240ba
More objective-C cleanup
Adlai-Holler Sep 16, 2015
e4dc823
hitTest:withEvent: return value should be nullable
Adlai-Holler Sep 16, 2015
6bcd245
Bump the .travis.yml OS X image requirement for Xcode 7
Adlai-Holler Sep 17, 2015
cde7901
Merge branch 'master' into update-objc
Adlai-Holler Sep 17, 2015
717df1c
Merge latest master and update Layout headers
Adlai-Holler Sep 17, 2015
309ecca
In ASLayoutOptions, make initWithLayoutable: take a nullable argument
Adlai-Holler Sep 17, 2015
c010dda
Update all the files in the Details group
Adlai-Holler Sep 17, 2015
38706d0
Fix nullability in ASImageDownloaderProtocol completion handler
Adlai-Holler Sep 17, 2015
ba9a742
Fix nullability of ASImageDownloaderProtocol to conform to ASBasicIma…
Adlai-Holler Sep 17, 2015
fd3a90a
Make image download token optional
Adlai-Holler Sep 17, 2015
f20a0d4
Add some nullables in ASTextNode
Adlai-Holler Sep 18, 2015
f37a88d
Give a prefix to make ASImageIdentifier typealias
Adlai-Holler Sep 19, 2015
ffbf84f
Point travis at 9.0 SDK
Adlai-Holler Sep 19, 2015
dc5650d
Revert "Point travis at 9.0 SDK"
Adlai-Holler Sep 19, 2015
70c5582
Bump SDK in build.sh
Adlai-Holler Sep 19, 2015
37e2a53
Merge branch 'master' into update-objc
Adlai-Holler Sep 19, 2015
9d6b3b6
Merge branch 'master' into update-objc
Adlai-Holler Sep 21, 2015
441a0e6
Update types for drawParameters
Adlai-Holler Sep 21, 2015
73af8f1
Simplify ASImageIdentifier definition
Adlai-Holler Sep 27, 2015
8bb9d17
Merge branch 'master' into update-objc
Adlai-Holler Oct 5, 2015
ee970d4
Annotate ASCollectionViewProtocols.h
Adlai-Holler Oct 5, 2015
b1e60a9
Merge branch 'master' into update-objc
Adlai-Holler Oct 14, 2015
fb03412
Fix nullability in MultiplexImageNodeDataSource
Adlai-Holler Oct 14, 2015
8e104f4
Merge branch 'master' into update-objc
Adlai-Holler Oct 29, 2015
0e90d05
Fix UIView+ASConvenience.h merge
Adlai-Holler Oct 29, 2015
f2a095a
Fix test build by casting test image identifiers
Adlai-Holler Oct 29, 2015
82c1549
Fix nullability of ASDisplayNode.name
Adlai-Holler Oct 29, 2015
b4b88da
Merge branch 'master' into update-objc
Adlai-Holler Nov 2, 2015
802011e
Merge branch 'master' into update-objc
Adlai-Holler Nov 9, 2015
bfe3040
Update nullability in ASCellNode.h
Adlai-Holler Nov 9, 2015
057e983
Add NSObjectProtocol requirement to ASImageIdentifier
Adlai-Holler Nov 13, 2015
762be97
Merge branch 'master' into update-objc
Adlai-Holler Nov 13, 2015
7922895
(Re?)add type annotations on touchesBegan:withEvent: et al
Adlai-Holler Nov 13, 2015
ab326fc
touchesCancelled:withEvent: has a nullable touches argument in UIKit …
Adlai-Holler Nov 13, 2015
ecaabc8
Merge branch 'master' into update-objc
Adlai-Holler Nov 18, 2015
dfc098f
Merge branch 'master' into update-objc
Adlai-Holler Nov 25, 2015
628bb7e
Revert minor deletion
Adlai-Holler Nov 25, 2015
fdfe188
Merge branch 'master' into update-objc
Adlai-Holler Dec 2, 2015
8e75c59
Add some more annotations
Adlai-Holler Dec 2, 2015
1fd65c2
Annotate ASAsciiArtBoxCreator.h
Adlai-Holler Dec 2, 2015
73b9002
Merge branch 'master' into update-objc
Adlai-Holler Dec 2, 2015
b16a9e2
Merge branch 'master' into update-objc
Adlai-Holler Dec 6, 2015
7079a9c
Merge branch 'master' into update-objc
Adlai-Holler Dec 13, 2015
e202b18
Annotate some new stuff
Adlai-Holler Dec 13, 2015
69767d5
Merge branch 'master' into update-objc
Adlai-Holler Dec 22, 2015
882d4b3
Merge branch 'master' into pr/664
Dec 25, 2015
c6fa897
Add nullability annotations to newer APIs that lacked it from the ori…
Dec 25, 2015
be3371e
Merge branch 'master' into pr/664
Dec 25, 2015
89f9fc5
Update Travis build server to use Xcode 7.2.
Dec 25, 2015
a2cf2a8
Overhaul header files / includes to eliminate circular references tha…
Dec 26, 2015
7b0c82b
Update to use iOS 9.2 simulator for testing, as Xcode 7.2 Travis appa…
Dec 26, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: objective-c
osx_image: xcode7
osx_image: xcode7.2
before_install:
- brew update
- brew reinstall xctool
Expand Down
Binary file modified AsyncDisplayKit-Prefix.gcda
Binary file not shown.
3 changes: 2 additions & 1 deletion AsyncDisplayKit/ASButtonNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
* of patent rights can be found in the PATENTS file in the same directory.
*/

#import <AsyncDisplayKit/AsyncDisplayKit.h>
#import <AsyncDisplayKit/ASTextNode.h>
#import <AsyncDisplayKit/ASImageNode.h>

typedef enum : NSUInteger {
ASButtonStateNormal,
Expand Down
5 changes: 3 additions & 2 deletions AsyncDisplayKit/ASButtonNode.mm
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
*/

#import "ASButtonNode.h"

#import <AsyncDisplayKit/ASThread.h>
#import "ASStackLayoutSpec.h"
#import "ASThread.h"
#import "ASDisplayNode+Subclasses.h"

@interface ASButtonNode ()
{
Expand Down
12 changes: 8 additions & 4 deletions AsyncDisplayKit/ASCellNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

#import <AsyncDisplayKit/ASDisplayNode.h>

NS_ASSUME_NONNULL_BEGIN

@class ASCellNode;

typedef NSUInteger ASCellNodeAnimation;
Expand Down Expand Up @@ -77,10 +79,10 @@ typedef NSUInteger ASCellNodeAnimation;
* ASCellNode must forward touch events in order for UITableView and UICollectionView tap handling to work. Overriding
* these methods (e.g. for highlighting) requires the super method be called.
*/
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event ASDISPLAYNODE_REQUIRES_SUPER;
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event ASDISPLAYNODE_REQUIRES_SUPER;
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event ASDISPLAYNODE_REQUIRES_SUPER;
- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event ASDISPLAYNODE_REQUIRES_SUPER;
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(nullable UIEvent *)event ASDISPLAYNODE_REQUIRES_SUPER;
- (void)touchesMoved:(NSSet<UITouch *> *)touches withEvent:(nullable UIEvent *)event ASDISPLAYNODE_REQUIRES_SUPER;
- (void)touchesEnded:(NSSet<UITouch *> *)touches withEvent:(nullable UIEvent *)event ASDISPLAYNODE_REQUIRES_SUPER;
- (void)touchesCancelled:(nullable NSSet<UITouch *> *)touches withEvent:(nullable UIEvent *)event ASDISPLAYNODE_REQUIRES_SUPER;

/**
* Marks the node as needing layout. Convenience for use whether the view / layer is loaded or not.
Expand Down Expand Up @@ -119,3 +121,5 @@ typedef NSUInteger ASCellNodeAnimation;
@property (nonatomic, copy) NSString *text;

@end

NS_ASSUME_NONNULL_END
3 changes: 2 additions & 1 deletion AsyncDisplayKit/ASCellNode.m
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,8 @@ - (instancetype)init
{
if (!(self = [super init]))
return nil;


_text = @"";
_textNode = [[ASTextNode alloc] init];
[self addSubnode:_textNode];

Expand Down
4 changes: 4 additions & 0 deletions AsyncDisplayKit/ASCollectionNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

#import <AsyncDisplayKit/ASCollectionView.h>

NS_ASSUME_NONNULL_BEGIN

/**
* ASCollectionNode is a node based class that wraps an ASCollectionView. It can be used
* as a subnode of another node, and provide room for many (great) features and improvements later on.
Expand Down Expand Up @@ -67,3 +69,5 @@
- (void)reloadDataImmediately;

@end

NS_ASSUME_NONNULL_END
3 changes: 2 additions & 1 deletion AsyncDisplayKit/ASCollectionNode.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ @implementation ASCollectionNode
- (instancetype)init
{
ASDISPLAYNODE_NOT_DESIGNATED_INITIALIZER();
self = [self initWithCollectionViewLayout:nil]; // Will throw an exception for lacking a UICV Layout.
UICollectionViewLayout *nilLayout = nil;
self = [self initWithCollectionViewLayout:nilLayout]; // Will throw an exception for lacking a UICV Layout.
return nil;
}

Expand Down
20 changes: 12 additions & 8 deletions AsyncDisplayKit/ASCollectionView.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
@protocol ASCollectionDelegate;
@protocol ASCollectionViewLayoutInspecting;

NS_ASSUME_NONNULL_BEGIN

/**
* Node-based collection view.
*
Expand Down Expand Up @@ -87,7 +89,7 @@
* Boolean parameter that contains the value YES if all of the related animations completed successfully or
* NO if they were interrupted. This parameter may be nil. If supplied, the block is run on the main thread.
*/
- (void)performBatchAnimated:(BOOL)animated updates:(void (^)())updates completion:(void (^)(BOOL))completion;
- (void)performBatchAnimated:(BOOL)animated updates:(void (^ _Nullable)())updates completion:(void (^ _Nullable)(BOOL))completion;

/**
* Perform a batch of updates asynchronously. This method must be called from the main thread.
Expand All @@ -98,7 +100,7 @@
* Boolean parameter that contains the value YES if all of the related animations completed successfully or
* NO if they were interrupted. This parameter may be nil. If supplied, the block is run on the main thread.
*/
- (void)performBatchUpdates:(void (^)())updates completion:(void (^)(BOOL))completion;
- (void)performBatchUpdates:(void (^ _Nullable)())updates completion:(void (^ _Nullable)(BOOL))completion;

/**
* Reload everything from scratch, destroying the working range and all cached nodes.
Expand All @@ -107,7 +109,7 @@
* the main thread.
* @warning This method is substantially more expensive than UICollectionView's version.
*/
- (void)reloadDataWithCompletion:(void (^)())completion;
- (void)reloadDataWithCompletion:(void (^ _Nullable)())completion;

/**
* Reload everything from scratch, destroying the working range and all cached nodes.
Expand Down Expand Up @@ -186,7 +188,7 @@
* @discussion This method must be called from the main thread. The asyncDataSource must be updated to reflect the changes
* before this method is called.
*/
- (void)insertItemsAtIndexPaths:(NSArray *)indexPaths;
- (void)insertItemsAtIndexPaths:(NSArray<NSIndexPath *> *)indexPaths;

/**
* Deletes the items specified by an array of index paths.
Expand All @@ -196,7 +198,7 @@
* @discussion This method must be called from the main thread. The asyncDataSource must be updated to reflect the changes
* before this method is called.
*/
- (void)deleteItemsAtIndexPaths:(NSArray *)indexPaths;
- (void)deleteItemsAtIndexPaths:(NSArray<NSIndexPath *> *)indexPaths;

/**
* Reloads the specified items.
Expand All @@ -206,7 +208,7 @@
* @discussion This method must be called from the main thread. The asyncDataSource must be updated to reflect the changes
* before this method is called.
*/
- (void)reloadItemsAtIndexPaths:(NSArray *)indexPaths;
- (void)reloadItemsAtIndexPaths:(NSArray<NSIndexPath *> *)indexPaths;

/**
* Moves the item at a specified location to a destination location.
Expand Down Expand Up @@ -243,7 +245,7 @@
*
* @returns an array containing the nodes being displayed on screen.
*/
- (NSArray *)visibleNodes;
- (NSArray<ASCellNode *> *)visibleNodes;

/**
* Query the sized node at `indexPath` for its calculatedSize.
Expand Down Expand Up @@ -354,7 +356,7 @@
@optional

- (void)collectionView:(ASCollectionView *)collectionView willDisplayNodeForItemAtIndexPath:(NSIndexPath *)indexPath;
- (void)collectionView:(ASCollectionView *)collectionView didEndDisplayingNodeForItemAtIndexPath:(NSIndexPath*)indexPath;
- (void)collectionView:(ASCollectionView *)collectionView didEndDisplayingNodeForItemAtIndexPath:(NSIndexPath *)indexPath;

/**
* Receive a message that the collectionView is near the end of its data set and more data should be fetched if
Expand Down Expand Up @@ -423,3 +425,5 @@
- (instancetype)initWithFrame:(CGRect)frame collectionViewLayout:(UICollectionViewLayout *)layout asyncDataFetching:(BOOL)asyncDataFetchingEnabled ASDISPLAYNODE_DEPRECATED;

@end

NS_ASSUME_NONNULL_END
1 change: 0 additions & 1 deletion AsyncDisplayKit/ASCollectionView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#import "ASAssert.h"
#import "ASBatchFetching.h"
#import "ASDelegateProxy.h"
#import "ASCollectionView.h"
#import "ASCollectionNode.h"
#import "ASCollectionDataController.h"
#import "ASCollectionViewLayoutController.h"
Expand Down
8 changes: 6 additions & 2 deletions AsyncDisplayKit/ASCollectionViewProtocols.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
* of patent rights can be found in the PATENTS file in the same directory.
*/

NS_ASSUME_NONNULL_BEGIN

/**
* This is a subset of UICollectionViewDataSource.
*
Expand Down Expand Up @@ -50,7 +52,9 @@
- (void)collectionView:(UICollectionView *)collectionView didDeselectItemAtIndexPath:(NSIndexPath *)indexPath;

- (BOOL)collectionView:(UICollectionView *)collectionView shouldShowMenuForItemAtIndexPath:(NSIndexPath *)indexPath;
- (BOOL)collectionView:(UICollectionView *)collectionView canPerformAction:(SEL)action forItemAtIndexPath:(NSIndexPath *)indexPath withSender:(id)sender;
- (void)collectionView:(UICollectionView *)collectionView performAction:(SEL)action forItemAtIndexPath:(NSIndexPath *)indexPath withSender:(id)sender;
- (BOOL)collectionView:(UICollectionView *)collectionView canPerformAction:(SEL)action forItemAtIndexPath:(NSIndexPath *)indexPath withSender:(nullable id)sender;
- (void)collectionView:(UICollectionView *)collectionView performAction:(SEL)action forItemAtIndexPath:(NSIndexPath *)indexPath withSender:(nullable id)sender;

@end

NS_ASSUME_NONNULL_END
15 changes: 9 additions & 6 deletions AsyncDisplayKit/ASControlNode+Subclasses.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
* of patent rights can be found in the PATENTS file in the same directory.
*/

#import <AsyncDisplayKit/ASControlNode.h>
#import "ASControlNode.h"

NS_ASSUME_NONNULL_BEGIN

/**
* The subclass header _ASControlNode+Subclasses_ defines methods to be
Expand All @@ -24,40 +25,42 @@
@param touchEvent An event object encapsulating the information specific to the user event.
@discussion ASControlNode implements this method to send all action messages associated with controlEvents. The list of targets is constructed from prior invocations of addTarget:action:forControlEvents:.
*/
- (void)sendActionsForControlEvents:(ASControlNodeEvent)controlEvents withEvent:(UIEvent *)touchEvent;
- (void)sendActionsForControlEvents:(ASControlNodeEvent)controlEvents withEvent:(nullable UIEvent *)touchEvent;

/**
@abstract Sent to the control when tracking begins.
@param touch The touch on the receiving control.
@param touchEvent An event object encapsulating the information specific to the user event.
@result YES if the receiver should respond continuously (respond when touch is dragged); NO otherwise.
*/
- (BOOL)beginTrackingWithTouch:(UITouch *)touch withEvent:(UIEvent *)touchEvent;
- (BOOL)beginTrackingWithTouch:(UITouch *)touch withEvent:(nullable UIEvent *)touchEvent;

/**
@abstract Sent continuously to the control as it tracks a touch within the control's bounds.
@param touch The touch on the receiving control.
@param touchEvent An event object encapsulating the information specific to the user event.
@result YES if touch tracking should continue; NO otherwise.
*/
- (BOOL)continueTrackingWithTouch:(UITouch *)touch withEvent:(UIEvent *)touchEvent;
- (BOOL)continueTrackingWithTouch:(UITouch *)touch withEvent:(nullable UIEvent *)touchEvent;

/**
@abstract Sent to the control when tracking should be cancelled.
@param touchEvent An event object encapsulating the information specific to the user event. This parameter may be nil, indicating that the cancelation was caused by something other than an event, such as the display node being removed from its supernode.
*/
- (void)cancelTrackingWithEvent:(UIEvent *)touchEvent;
- (void)cancelTrackingWithEvent:(nullable UIEvent *)touchEvent;

/**
@abstract Sent to the control when the last touch completely ends, telling it to stop tracking.
@param touch The touch that ended.
@param touchEvent An event object encapsulating the information specific to the user event.
*/
- (void)endTrackingWithTouch:(UITouch *)touch withEvent:(UIEvent *)touchEvent;
- (void)endTrackingWithTouch:(nullable UITouch *)touch withEvent:(nullable UIEvent *)touchEvent;

/**
@abstract Settable version of highlighted property.
*/
@property (nonatomic, readwrite, assign, getter=isHighlighted) BOOL highlighted;

@end

NS_ASSUME_NONNULL_END
11 changes: 7 additions & 4 deletions AsyncDisplayKit/ASControlNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#import <AsyncDisplayKit/ASDisplayNode.h>

NS_ASSUME_NONNULL_BEGIN

/**
@abstract Kinds of events possible for control nodes.
Expand Down Expand Up @@ -75,15 +76,15 @@ typedef NS_OPTIONS(NSUInteger, ASControlNodeEvent)
@param controlEvents A bitmask specifying the control events for which the action message is sent. May not be 0. See "Control Events" for bitmask constants.
@discussion You may call this method multiple times, and you may specify multiple target-action pairs for a particular event. Targets are held weakly.
*/
- (void)addTarget:(id)target action:(SEL)action forControlEvents:(ASControlNodeEvent)controlEvents;
- (void)addTarget:(nullable id)target action:(SEL)action forControlEvents:(ASControlNodeEvent)controlEvents;

/**
@abstract Returns the actions that are associated with a target and a particular control event.
@param target The target object. May not be nil.
@param controlEvent A single constant of type ASControlNodeEvent that specifies a particular user action on the control; for a list of these constants, see "Control Events". May not be 0 or ASControlNodeEventAllEvents.
@result An array of selector names as NSString objects, or nil if there are no action selectors associated with controlEvent.
*/
- (NSArray *)actionsForTarget:(id)target forControlEvent:(ASControlNodeEvent)controlEvent;
- (nullable NSArray<NSString *> *)actionsForTarget:(id)target forControlEvent:(ASControlNodeEvent)controlEvent;

/**
@abstract Returns all target objects associated with the receiver.
Expand All @@ -97,13 +98,15 @@ typedef NS_OPTIONS(NSUInteger, ASControlNodeEvent)
@param action A selector identifying an action message. Pass NULL to remove all action messages paired with target.
@param controlEvents A bitmask specifying the control events associated with target and action. See "Control Events" for bitmask constants. May not be 0.
*/
- (void)removeTarget:(id)target action:(SEL)action forControlEvents:(ASControlNodeEvent)controlEvents;
- (void)removeTarget:(nullable id)target action:(nullable SEL)action forControlEvents:(ASControlNodeEvent)controlEvents;

/**
@abstract Sends the actions for the control events for a particular event.
@param controlEvents A bitmask specifying the control events for which to send actions. See "Control Events" for bitmask constants. May not be 0.
@param event The event which triggered these control actions. May be nil.
*/
- (void)sendActionsForControlEvents:(ASControlNodeEvent)controlEvents withEvent:(UIEvent *)event;
- (void)sendActionsForControlEvents:(ASControlNodeEvent)controlEvents withEvent:(nullable UIEvent *)event;

@end

NS_ASSUME_NONNULL_END
Loading