ASCollectionView(Deprecated) Category Reference
Declared in | ASCollectionView.h |
---|
– initWithCollectionViewLayout:
Initializes an ASCollectionView
- (instancetype)initWithCollectionViewLayout:(UICollectionViewLayout *)layout
Parameters
layout |
The layout object to use for organizing items. The collection view stores a strong reference to the specified object. Must not be nil. |
---|
Discussion
Initializes and returns a newly allocated collection view object with the specified layout.
Declared In
ASCollectionView.h
– initWithFrame:collectionViewLayout:
Initializes an ASCollectionView
- (instancetype)initWithFrame:(CGRect)frame collectionViewLayout:(UICollectionViewLayout *)layout
Parameters
frame |
The frame rectangle for the collection view, measured in points. The origin of the frame is relative to the superview in which you plan to add it. This frame is passed to the superclass during initialization. |
---|---|
layout |
The layout object to use for organizing items. The collection view stores a strong reference to the specified object. Must not be nil. |
Discussion
Initializes and returns a newly allocated collection view object with the specified frame and layout.
Declared In
ASCollectionView.h
– tuningParametersForRangeType:
Tuning parameters for a range type in full mode.
- (ASRangeTuningParameters)tuningParametersForRangeType:(ASLayoutRangeType)rangeType
Parameters
rangeType |
The range type to get the tuning parameters for. |
---|
Return Value
A tuning parameter value for the given range type in full mode.
Declared In
ASCollectionView.h
– setTuningParameters:forRangeType:
Set the tuning parameters for a range type in full mode.
- (void)setTuningParameters:(ASRangeTuningParameters)tuningParameters forRangeType:(ASLayoutRangeType)rangeType
Parameters
tuningParameters |
The tuning parameters to store for a range type. |
---|---|
rangeType |
The range type to set the tuning parameters for. |
Declared In
ASCollectionView.h
– tuningParametersForRangeMode:rangeType:
Tuning parameters for a range type in the specified mode.
- (ASRangeTuningParameters)tuningParametersForRangeMode:(ASLayoutRangeMode)rangeMode rangeType:(ASLayoutRangeType)rangeType
Parameters
rangeMode |
The range mode to get the running parameters for. |
---|---|
rangeType |
The range type to get the tuning parameters for. |
Return Value
A tuning parameter value for the given range type in the given mode.
Declared In
ASCollectionView.h
– setTuningParameters:forRangeMode:rangeType:
Set the tuning parameters for a range type in the specified mode.
- (void)setTuningParameters:(ASRangeTuningParameters)tuningParameters forRangeMode:(ASLayoutRangeMode)rangeMode rangeType:(ASLayoutRangeType)rangeType
Parameters
tuningParameters |
The tuning parameters to store for a range type. |
---|---|
rangeMode |
The range mode to set the running parameters for. |
rangeType |
The range type to set the tuning parameters for. |
Declared In
ASCollectionView.h
– performBatchAnimated:updates:completion:
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.
- (void)performBatchAnimated:(BOOL)animated updates:(nullable __attribute ( ( noescape ) ) void ( ^ ) ( ))updates completion:(nullable void ( ^ ) ( BOOL finished ))completion
Parameters
animated |
NO to disable animations for this batch |
---|---|
updates |
The block that performs the relevant insert, delete, reload, or move operations. |
completion |
A completion handler block to execute when all of the operations are finished. This block takes a single 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. |
Declared In
ASCollectionView.h
– performBatchUpdates:completion:
Perform a batch of updates asynchronously. This method must be called from the main thread. The asyncDataSource must be updated to reflect the changes before update block completes.
- (void)performBatchUpdates:(nullable __attribute ( ( noescape ) ) void ( ^ ) ( ))updates completion:(nullable void ( ^ ) ( BOOL finished ))completion
Parameters
updates |
The block that performs the relevant insert, delete, reload, or move operations. |
---|---|
completion |
A completion handler block to execute when all of the operations are finished. This block takes a single 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. |
Declared In
ASCollectionView.h
– reloadDataWithCompletion:
Reload everything from scratch, destroying the working range and all cached nodes.
- (void)reloadDataWithCompletion:(nullable void ( ^ ) ( ))completion
Parameters
completion |
block to run on completion of asynchronous loading or nil. If supplied, the block is run on the main thread. |
---|
Discussion
Warning: This method is substantially more expensive than UICollectionView’s version.
Declared In
ASCollectionView.h
– reloadData
Reload everything from scratch, destroying the working range and all cached nodes.
- (void)reloadData
Discussion
Warning: This method is substantially more expensive than UICollectionView’s version.
Declared In
ASCollectionView.h
– reloadDataImmediately
Reload everything from scratch entirely on the main thread, destroying the working range and all cached nodes.
- (void)reloadDataImmediately
Discussion
Warning: This method is substantially more expensive than UICollectionView’s version and will block the main thread while all the cells load.
Declared In
ASCollectionView.h
– relayoutItems
Triggers a relayout of all nodes.
- (void)relayoutItems
Discussion
This method invalidates and lays out every cell node in the collection.
Declared In
ASCollectionView.h
– waitUntilAllUpdatesAreCommitted
Blocks execution of the main thread until all section and row updates are committed. This method must be called from the main thread.
- (void)waitUntilAllUpdatesAreCommitted
Declared In
ASCollectionView.h
– registerSupplementaryNodeOfKind:
Registers the given kind of supplementary node for use in creating node-backed supplementary views.
- (void)registerSupplementaryNodeOfKind:(NSString *)elementKind
Parameters
elementKind |
The kind of supplementary node that will be requested through the data source. |
---|
Discussion
Use this method to register support for the use of supplementary nodes in place of the default
registerClass:forSupplementaryViewOfKind:withReuseIdentifier:
and registerNib:forSupplementaryViewOfKind:withReuseIdentifier:
methods. This method will register an internal backing view that will host the contents of the supplementary nodes
returned from the data source.
Declared In
ASCollectionView.h
– insertSections:
Inserts one or more sections.
- (void)insertSections:(NSIndexSet *)sections
Parameters
sections |
An index set that specifies the sections to insert. |
---|
Discussion
This method must be called from the main thread. The asyncDataSource must be updated to reflect the changes before this method is called.
Declared In
ASCollectionView.h
– deleteSections:
Deletes one or more sections.
- (void)deleteSections:(NSIndexSet *)sections
Parameters
sections |
An index set that specifies the sections to delete. |
---|
Discussion
This method must be called from the main thread. The asyncDataSource must be updated to reflect the changes before this method is called.
Declared In
ASCollectionView.h
– reloadSections:
Reloads the specified sections.
- (void)reloadSections:(NSIndexSet *)sections
Parameters
sections |
An index set that specifies the sections to reload. |
---|
Discussion
This method must be called from the main thread. The asyncDataSource must be updated to reflect the changes before this method is called.
Declared In
ASCollectionView.h
– moveSection:toSection:
Moves a section to a new location.
- (void)moveSection:(NSInteger)section toSection:(NSInteger)newSection
Parameters
section |
The index of the section to move. |
---|---|
newSection |
The index that is the destination of the move for the section. |
Discussion
This method must be called from the main thread. The asyncDataSource must be updated to reflect the changes before this method is called.
Declared In
ASCollectionView.h
– insertItemsAtIndexPaths:
Inserts items at the locations identified by an array of index paths.
- (void)insertItemsAtIndexPaths:(NSArray<NSIndexPath*> *)indexPaths
Parameters
indexPaths |
An array of NSIndexPath objects, each representing an item index and section index that together identify an item. |
---|
Discussion
This method must be called from the main thread. The asyncDataSource must be updated to reflect the changes before this method is called.
Declared In
ASCollectionView.h
– deleteItemsAtIndexPaths:
Deletes the items specified by an array of index paths.
- (void)deleteItemsAtIndexPaths:(NSArray<NSIndexPath*> *)indexPaths
Parameters
indexPaths |
An array of NSIndexPath objects identifying the items to delete. |
---|
Discussion
This method must be called from the main thread. The asyncDataSource must be updated to reflect the changes before this method is called.
Declared In
ASCollectionView.h
– reloadItemsAtIndexPaths:
Reloads the specified items.
- (void)reloadItemsAtIndexPaths:(NSArray<NSIndexPath*> *)indexPaths
Parameters
indexPaths |
An array of NSIndexPath objects identifying the items to reload. |
---|
Discussion
This method must be called from the main thread. The asyncDataSource must be updated to reflect the changes before this method is called.
Declared In
ASCollectionView.h
– moveItemAtIndexPath:toIndexPath:
Moves the item at a specified location to a destination location.
- (void)moveItemAtIndexPath:(NSIndexPath *)indexPath toIndexPath:(NSIndexPath *)newIndexPath
Parameters
indexPath |
The index path identifying the item to move. |
---|---|
newIndexPath |
The index path that is the destination of the move for the item. |
Discussion
This method must be called from the main thread. The asyncDataSource must be updated to reflect the changes before this method is called.
Declared In
ASCollectionView.h
– calculatedSizeForNodeAtIndexPath:
Query the sized node at @c indexPath for its calculatedSize.
- (CGSize)calculatedSizeForNodeAtIndexPath:(NSIndexPath *)indexPath
Parameters
indexPath |
The index path for the node of interest. This method is deprecated. Call @c calculatedSize on the node of interest instead. First deprecated in version 2.0. |
---|
Declared In
ASCollectionView.h
– visibleNodes
Similar to -visibleCells.
- (NSArray<__kindofASCellNode*> *)visibleNodes
Return Value
an array containing the nodes being displayed on screen.
Declared In
ASCollectionView.h
– indexPathForNode:
Similar to -indexPathForCell:.
- (nullable NSIndexPath *)indexPathForNode:(ASCellNode *)cellNode
Parameters
cellNode |
a cellNode in the collection view |
---|
Return Value
The index path for this cell node.
Discussion
This index path returned by this method is in the view’s index space and should only be used with @c ASCollectionView directly. To get an index path suitable for use with your data source and @c ASCollectionNode, call @c indexPathForNode: on the collection node instead.
Declared In
ASCollectionView.h