From eb5c79598c563f19ca6a91583c05856baf5b3cf7 Mon Sep 17 00:00:00 2001 From: Levi McCallum Date: Sun, 11 Oct 2015 10:25:49 -0700 Subject: [PATCH] Clean up arrangement of data controller subclassing methods --- .../Details/ASDataController+Subclasses.h | 21 ++++++------------- AsyncDisplayKit/Details/ASDataController.mm | 11 ++++++++++ 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/AsyncDisplayKit/Details/ASDataController+Subclasses.h b/AsyncDisplayKit/Details/ASDataController+Subclasses.h index 1bb3615e7e..16ab8cc028 100644 --- a/AsyncDisplayKit/Details/ASDataController+Subclasses.h +++ b/AsyncDisplayKit/Details/ASDataController+Subclasses.h @@ -10,21 +10,6 @@ @interface ASDataController (Subclasses) -/** - * Queues the given operation until an `endUpdates` synchronize update is completed. - * - * If this method is called outside of a begin/endUpdates batch update, the block is - * executed immediately. - */ -- (void)performEditCommandWithBlock:(void (^)(void))block; - -/** - * Safely locks access to the data source and executes the given block, unlocking once complete. - * - * When `asyncDataFetching` is enabled, the block is executed on a background thread. - */ -- (void)accessDataSourceWithBlock:(dispatch_block_t)block; - - (void)willPerformInitialDataLoading; /** @@ -51,6 +36,8 @@ - (void)willMoveSection:(NSInteger)section toSection:(NSInteger)newSection; +#pragma mark - Internal editing & completed store querying + /** * Provides a collection of index paths for nodes of the given kind that are currently in the editing store */ @@ -66,6 +53,8 @@ */ - (NSMutableArray *)completedNodesOfKind:(NSString *)kind; +#pragma mark - Node sizing + /** * Measure and layout the given nodes in optimized batches, constraining each to a given size in `constrainedSizeForNodeOfKind:atIndexPath:`. */ @@ -76,6 +65,8 @@ */ - (ASSizeRange)constrainedSizeForNodeOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath; +#pragma mark - Node & Section Insertion/Deletion API + /** * Inserts the given nodes of the specified kind into the backing store, calling completion on the main thread when the write finishes. */ diff --git a/AsyncDisplayKit/Details/ASDataController.mm b/AsyncDisplayKit/Details/ASDataController.mm index 85b4ab1925..84e979b713 100644 --- a/AsyncDisplayKit/Details/ASDataController.mm +++ b/AsyncDisplayKit/Details/ASDataController.mm @@ -425,6 +425,11 @@ static void *kASSizingQueueContext = &kASSizingQueueContext; #pragma mark - Data Source Access (Calling _dataSource) +/** + * Safely locks access to the data source and executes the given block, unlocking once complete. + * + * @discussion When `asyncDataFetching` is enabled, the block is executed on a background thread. + */ - (void)accessDataSourceWithBlock:(dispatch_block_t)block { if (_asyncDataFetchingEnabled) { @@ -534,6 +539,12 @@ static void *kASSizingQueueContext = &kASSizingQueueContext; } } +/** + * Queues the given operation until an `endUpdates` synchronize update is completed. + * + * If this method is called outside of a begin/endUpdates batch update, the block is + * executed immediately. + */ - (void)performEditCommandWithBlock:(void (^)(void))block { // This method needs to block the thread and synchronously perform the operation if we are not