From 68990cb6ccb5b48072f3d46fc357eefc525364e6 Mon Sep 17 00:00:00 2001 From: Garrett Moon Date: Mon, 31 Oct 2016 17:30:40 -0700 Subject: [PATCH] =?UTF-8?q?Deprecations=20should=20be=20re-enabled.=20If?= =?UTF-8?q?=20there=20are=20specific=20deprecations=E2=80=A6=20(#2519)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Deprecations should be re-enabled. If there are specific deprecations we'd like to hold off on, we should address those specifically. * Fix decleration * Move select to undeprecated * Fix deprecations --- AsyncDisplayKit/ASTableView.h | 2 +- AsyncDisplayKit/Layout/ASDimension.h | 4 ++-- .../Private/ASCollectionView+Undeprecated.h | 11 +++++++++++ AsyncDisplayKit/Private/ASTableView+Undeprecated.h | 11 +++++++++++ AsyncDisplayKitTests/ASTableViewTests.m | 4 ++-- Base/ASBaseDefines.h | 2 +- 6 files changed, 28 insertions(+), 6 deletions(-) diff --git a/AsyncDisplayKit/ASTableView.h b/AsyncDisplayKit/ASTableView.h index b454e497ed..f12978c052 100644 --- a/AsyncDisplayKit/ASTableView.h +++ b/AsyncDisplayKit/ASTableView.h @@ -133,7 +133,7 @@ NS_ASSUME_NONNULL_BEGIN */ - (void)scrollToRowAtIndexPath:(NSIndexPath *)indexPath atScrollPosition:(UITableViewScrollPosition)scrollPosition animated:(BOOL)animated ASDISPLAYNODE_DEPRECATED_MSG("Use ASTableNode method instead."); -- (void)selectRowAtIndexPath:(NSIndexPath *)indexPath animated:(BOOL)animated scrollPosition:(UITableViewScrollPosition)scrollPosition; ASDISPLAYNODE_DEPRECATED_MSG("Use ASTableNode method instead."); +- (void)selectRowAtIndexPath:(NSIndexPath *)indexPath animated:(BOOL)animated scrollPosition:(UITableViewScrollPosition)scrollPosition ASDISPLAYNODE_DEPRECATED_MSG("Use ASTableNode method instead."); /** * Similar to -visibleCells. diff --git a/AsyncDisplayKit/Layout/ASDimension.h b/AsyncDisplayKit/Layout/ASDimension.h index c8889d9e7f..f0a75a7f16 100644 --- a/AsyncDisplayKit/Layout/ASDimension.h +++ b/AsyncDisplayKit/Layout/ASDimension.h @@ -360,9 +360,9 @@ typedef NS_ENUM(NSInteger, ASRelativeDimensionType) { #define ASRelativeDimensionMakeWithFraction ASDimensionMakeWithFraction /** - * Function is deprecated. Use ASSizeRangeMakeWithExactCGSize instead. + * Function is deprecated. Use ASSizeRangeMake instead. */ -extern AS_WARN_UNUSED_RESULT ASSizeRange ASSizeRangeMakeExactSize(CGSize size) ASDISPLAYNODE_DEPRECATED_MSG("Use ASSizeRangeMakeWithExactCGSize instead."); +extern AS_WARN_UNUSED_RESULT ASSizeRange ASSizeRangeMakeExactSize(CGSize size) ASDISPLAYNODE_DEPRECATED_MSG("Use ASSizeRangeMake instead."); /** Expresses an inclusive range of relative sizes. Used to provide additional constraint to layout. diff --git a/AsyncDisplayKit/Private/ASCollectionView+Undeprecated.h b/AsyncDisplayKit/Private/ASCollectionView+Undeprecated.h index 79830fef9d..4c1762a129 100644 --- a/AsyncDisplayKit/Private/ASCollectionView+Undeprecated.h +++ b/AsyncDisplayKit/Private/ASCollectionView+Undeprecated.h @@ -86,6 +86,17 @@ NS_ASSUME_NONNULL_BEGIN */ - (void)setTuningParameters:(ASRangeTuningParameters)tuningParameters forRangeMode:(ASLayoutRangeMode)rangeMode rangeType:(ASLayoutRangeType)rangeType; +/** + * Scrolls the collection to the given item. + * + * @param indexPath The index path of the item. + * @param scrollPosition Where the row should end up after the scroll. + * @param animated Whether the scroll should be animated or not. + */ +- (void)scrollToItemAtIndexPath:(NSIndexPath *)indexPath atScrollPosition:(UICollectionViewScrollPosition)scrollPosition animated:(BOOL)animated; + +- (void)selectItemAtIndexPath:(NSIndexPath *)indexPath animated:(BOOL)animated scrollPosition:(UICollectionViewScrollPosition)scrollPosition; + /** * Perform a batch of updates asynchronously, optionally disabling all animations in the batch. This method must be called from the main thread. * The asyncDataSource must be updated to reflect the changes before the update block completes. diff --git a/AsyncDisplayKit/Private/ASTableView+Undeprecated.h b/AsyncDisplayKit/Private/ASTableView+Undeprecated.h index 9e2d3e5fd9..c6b99c56a1 100644 --- a/AsyncDisplayKit/Private/ASTableView+Undeprecated.h +++ b/AsyncDisplayKit/Private/ASTableView+Undeprecated.h @@ -77,6 +77,17 @@ NS_ASSUME_NONNULL_BEGIN */ - (void)setTuningParameters:(ASRangeTuningParameters)tuningParameters forRangeMode:(ASLayoutRangeMode)rangeMode rangeType:(ASLayoutRangeType)rangeType; +/** + * Scrolls the table to the given row. + * + * @param indexPath The index path of the row. + * @param scrollPosition Where the row should end up after the scroll. + * @param animated Whether the scroll should be animated or not. + */ +- (void)scrollToRowAtIndexPath:(NSIndexPath *)indexPath atScrollPosition:(UITableViewScrollPosition)scrollPosition animated:(BOOL)animated; + +- (void)selectRowAtIndexPath:(NSIndexPath *)indexPath animated:(BOOL)animated scrollPosition:(UITableViewScrollPosition)scrollPosition; + /** * Similar to -visibleCells. * diff --git a/AsyncDisplayKitTests/ASTableViewTests.m b/AsyncDisplayKitTests/ASTableViewTests.m index 27e1b4198f..f0c50bda3a 100644 --- a/AsyncDisplayKitTests/ASTableViewTests.m +++ b/AsyncDisplayKitTests/ASTableViewTests.m @@ -654,7 +654,7 @@ XCTAssertGreaterThan(node.numberOfSections, 0); [node waitUntilAllUpdatesAreCommitted]; - ASSizeRange expectedSizeRange = ASSizeRangeMakeExactSize(CGSizeMake(cellWidth, 0)); + ASSizeRange expectedSizeRange = ASSizeRangeMake(CGSizeMake(cellWidth, 0)); expectedSizeRange.max.height = CGFLOAT_MAX; for (NSInteger i = 0; i < node.numberOfSections; i++) { @@ -689,7 +689,7 @@ CGFloat cellWidth = cell.contentView.frame.size.width; XCTAssert(cellWidth > 0 && cellWidth < 320, @"Expected cell width to be about 305. Width: %@", @(cellWidth)); - ASSizeRange expectedSizeRange = ASSizeRangeMakeExactSize(CGSizeMake(cellWidth, 0)); + ASSizeRange expectedSizeRange = ASSizeRangeMake(CGSizeMake(cellWidth, 0)); expectedSizeRange.max.height = CGFLOAT_MAX; for (NSInteger i = 0; i < node.numberOfSections; i++) { diff --git a/Base/ASBaseDefines.h b/Base/ASBaseDefines.h index 8db12be97e..bfa3de4aec 100755 --- a/Base/ASBaseDefines.h +++ b/Base/ASBaseDefines.h @@ -71,7 +71,7 @@ #endif #ifndef ASDISPLAYNODE_WARN_DEPRECATED -# define ASDISPLAYNODE_WARN_DEPRECATED 0 +# define ASDISPLAYNODE_WARN_DEPRECATED 1 #endif #ifndef ASDISPLAYNODE_DEPRECATED