Deprecate indexPath-based Methods on ASTableView/ASCollectionView (#2498)

* Deprecated indexPath methods in ASTableView and ASTableNode and added several indexPath methods to ASTableNode and ASCollectionNode.

* Fixed incorrect doc.
Removed unnecessary __kindof.
This commit is contained in:
george-gw
2016-10-29 18:50:11 +02:00
committed by Adlai Holler
parent c4451edab1
commit d83f058f82
10 changed files with 257 additions and 62 deletions

View File

@@ -291,7 +291,6 @@ NS_ASSUME_NONNULL_BEGIN
*/
- (void)deselectRowAtIndexPath:(NSIndexPath *)indexPath animated:(BOOL)animated;
#pragma mark - Querying Data
/**
@@ -327,6 +326,74 @@ NS_ASSUME_NONNULL_BEGIN
*/
- (nullable NSIndexPath *)indexPathForNode:(ASCellNode *)cellNode AS_WARN_UNUSED_RESULT;
/**
* Similar to -[UITableView rectForRowAtIndexPath:]
*
* @param indexPath An index path identifying a row in the table view.
*
* @return A rectangle defining the area in which the table view draws the row or CGRectZero if indexPath is invalid.
*
* @discussion This method must be called from the main thread.
*/
- (CGRect)rectForRowAtIndexPath:(NSIndexPath *)indexPath AS_WARN_UNUSED_RESULT;
/**
* Similar to -[UITableView cellForRowAtIndexPath:]
*
* @param indexPath An index path identifying a row in the table view.
*
* @return An object representing a cell of the table, or nil if the cell is not visible or indexPath is out of range.
*
* @discussion This method must be called from the main thread.
*/
- (nullable __kindof UITableViewCell *)cellForRowAtIndexPath:(NSIndexPath *)indexPath AS_WARN_UNUSED_RESULT;
/**
* Similar to -[UITableView indexPathForSelectedRow]
*
* @return The value of this property is an index path identifying the row and section
* indexes of the selected row, or nil if the index path is invalid. If there are multiple selections,
* this property contains the first index-path object in the array of row selections;
* this object has the lowest index values for section and row.
*
* @discussion This method must be called from the main thread.
*/
- (nullable NSIndexPath *)indexPathForSelectedRow AS_WARN_UNUSED_RESULT;
/**
* Similar to -[UITableView indexPathForRowAtPoint:]
*
* @param point A point in the local coordinate system of the table view (the table view€™s bounds).
*
* @return An index path representing the row and section associated with point,
* or nil if the point is out of the bounds of any row.
*
* @discussion This method must be called from the main thread.
*/
- (nullable NSIndexPath *)indexPathForRowAtPoint:(CGPoint)point AS_WARN_UNUSED_RESULT;
/**
* Similar to -[UITableView indexPathsForRowsInRect:]
*
* @param rect A rectangle defining an area of the table view in local coordinates.
*
* @return An array of NSIndexPath objects each representing a row and section index identifying a row within rect.
* Returns an empty array if there arent any rows to return.
*
* @discussion This method must be called from the main thread.
*/
- (nullable NSArray<NSIndexPath *> *)indexPathsForRowsInRect:(CGRect)rect AS_WARN_UNUSED_RESULT;
/**
* Similar to -[UITableView indexPathsForVisibleRows]
*
* @return The value of this property is an array of NSIndexPath objects each representing a row index and section index
* that together identify a visible row in the table view. If no rows are visible, the value is nil.
*
* @discussion This method must be called from the main thread.
*/
- (NSArray<NSIndexPath *> *)indexPathsForVisibleRows AS_WARN_UNUSED_RESULT;
@end
/**