Files
AsyncDisplayKit/appledoc/Classes/ASCollectionView.html
2016-07-11 22:21:55 -07:00

2026 lines
53 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>ASCollectionView Class Reference</title>
<link rel="stylesheet" href="../css/style.css">
<meta name="viewport" content="initial-scale=1, maximum-scale=1.4">
<meta name="generator" content="appledoc 2.2.1 (build 1334)">
</head>
<body class="appledoc">
<header>
<div class="container" class="hide-in-xcode">
<h1 id="library-title">
<a href="../index.html">AsyncDisplayKit </a>
</h1>
<p id="developer-home">
<a href="../index.html">Facebook</a>
</p>
</div>
</header>
<aside>
<div class="container">
<nav>
<ul id="header-buttons" role="toolbar">
<li><a href="../index.html">Index</a></li>
<li><a href="../hierarchy.html">Hierarchy</a></li>
<li id="on-this-page" role="navigation">
<label>
On This Page
<div class="chevron">
<div class="chevy chevron-left"></div>
<div class="chevy chevron-right"></div>
</div>
<select id="jump-to">
<option value="top">Jump To&#133;</option>
<option value="overview">Overview</option>
<option value="tasks">Tasks</option>
<optgroup label="Properties">
<option value="//api/name/layoutInspector">layoutInspector</option>
<option value="//api/name/leadingScreensForBatching">leadingScreensForBatching</option>
<option value="//api/name/zeroContentInsets">zeroContentInsets</option>
</optgroup>
<optgroup label="Instance Methods">
<option value="//api/name/calculatedSizeForNodeAtIndexPath:">- calculatedSizeForNodeAtIndexPath:</option>
<option value="//api/name/clearContents">- clearContents</option>
<option value="//api/name/clearFetchedData">- clearFetchedData</option>
<option value="//api/name/deleteItemsAtIndexPaths:">- deleteItemsAtIndexPaths:</option>
<option value="//api/name/deleteSections:">- deleteSections:</option>
<option value="//api/name/indexPathForNode:">- indexPathForNode:</option>
<option value="//api/name/initWithCollectionViewLayout:">- initWithCollectionViewLayout:</option>
<option value="//api/name/insertItemsAtIndexPaths:">- insertItemsAtIndexPaths:</option>
<option value="//api/name/insertSections:">- insertSections:</option>
<option value="//api/name/moveItemAtIndexPath:toIndexPath:">- moveItemAtIndexPath:toIndexPath:</option>
<option value="//api/name/moveSection:toSection:">- moveSection:toSection:</option>
<option value="//api/name/nodeForItemAtIndexPath:">- nodeForItemAtIndexPath:</option>
<option value="//api/name/performBatchAnimated:updates:completion:">- performBatchAnimated:updates:completion:</option>
<option value="//api/name/performBatchUpdates:completion:">- performBatchUpdates:completion:</option>
<option value="//api/name/registerSupplementaryNodeOfKind:">- registerSupplementaryNodeOfKind:</option>
<option value="//api/name/relayoutItems">- relayoutItems</option>
<option value="//api/name/reloadData">- reloadData</option>
<option value="//api/name/reloadDataImmediately">- reloadDataImmediately</option>
<option value="//api/name/reloadDataWithCompletion:">- reloadDataWithCompletion:</option>
<option value="//api/name/reloadItemsAtIndexPaths:">- reloadItemsAtIndexPaths:</option>
<option value="//api/name/reloadSections:">- reloadSections:</option>
<option value="//api/name/scrollDirection">- scrollDirection</option>
<option value="//api/name/scrollableDirections">- scrollableDirections</option>
<option value="//api/name/setTuningParameters:forRangeMode:rangeType:">- setTuningParameters:forRangeMode:rangeType:</option>
<option value="//api/name/setTuningParameters:forRangeType:">- setTuningParameters:forRangeType:</option>
<option value="//api/name/supplementaryNodeForElementKind:atIndexPath:">- supplementaryNodeForElementKind:atIndexPath:</option>
<option value="//api/name/tuningParametersForRangeMode:rangeType:">- tuningParametersForRangeMode:rangeType:</option>
<option value="//api/name/tuningParametersForRangeType:">- tuningParametersForRangeType:</option>
<option value="//api/name/visibleNodes">- visibleNodes</option>
<option value="//api/name/waitUntilAllUpdatesAreCommitted">- waitUntilAllUpdatesAreCommitted</option>
</optgroup>
</select>
</label>
</li>
</ul>
</nav>
</div>
</aside>
<article>
<div id="overview_contents" class="container">
<div id="content">
<main role="main">
<h1 class="title">ASCollectionView Class Reference</h1>
<div class="section section-specification"><table cellspacing="0"><tbody>
<tr>
<th>Inherits from</th>
<td>UICollectionView</td>
</tr><tr>
<th>Declared in</th>
<td>ASCollectionView.h</td>
</tr>
</tbody></table></div>
<div class="section section-overview">
<a title="Overview" name="overview"></a>
<h2 class="subtitle subtitle-overview">Overview</h2>
<p>Asynchronous UICollectionView with Intelligent Preloading capabilities.</p>
<p>ASCollectionNode is recommended over ASCollectionView. This class exists for adoption convenience.</p>
<p>ASCollectionView is a true subclass of UICollectionView, meaning it is pointer-compatible
with code that currently uses UICollectionView.</p>
<p>The main difference is that asyncDataSource expects -nodeForItemAtIndexPath, an ASCellNode, and
the sizeForItemAtIndexPath: method is eliminated (as are the performance problems caused by it).
This is made possible because ASCellNodes can calculate their own size, and preload ahead of time.</p>
</div>
<div class="section section-tasks">
<a title="Tasks" name="tasks"></a>
<div class="task-list">
<div class="section-method">
<a name="//api/name/initWithCollectionViewLayout:" title="initWithCollectionViewLayout:"></a>
<h3 class="method-title"><code><a href="#//api/name/initWithCollectionViewLayout:">&ndash;&nbsp;initWithCollectionViewLayout:</a></code>
</h3>
<div class="method-info">
<div class="pointy-thing"></div>
<div class="method-info-container">
<div class="method-subsection brief-description">
<p>Initializer.</p>
</div>
<div class="method-subsection method-declaration"><code>- (instancetype)initWithCollectionViewLayout:(UICollectionViewLayout *)<em>layout</em></code></div>
<div class="method-subsection arguments-section parameters">
<h4 class="method-subtitle parameter-title">Parameters</h4>
<table class="argument-def parameter-def">
<tr>
<th scope="row" class="argument-name"><code>layout</code></th>
<td><p>The layout object to use for organizing items. The collection view stores a strong reference to the specified object. Must not be nil.</p></td>
</tr>
</table>
</div>
<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<p><code class="declared-in-ref">ASCollectionView.h</code></p>
</div>
</div>
</div>
</div><div class="section-method">
<a name="//api/name/tuningParametersForRangeType:" title="tuningParametersForRangeType:"></a>
<h3 class="method-title"><code><a href="#//api/name/tuningParametersForRangeType:">&ndash;&nbsp;tuningParametersForRangeType:</a></code>
</h3>
<div class="method-info">
<div class="pointy-thing"></div>
<div class="method-info-container">
<div class="method-subsection brief-description">
<p>Tuning parameters for a range type in full mode.</p>
</div>
<div class="method-subsection method-declaration"><code>- (ASRangeTuningParameters)tuningParametersForRangeType:(ASLayoutRangeType)<em>rangeType</em></code></div>
<div class="method-subsection arguments-section parameters">
<h4 class="method-subtitle parameter-title">Parameters</h4>
<table class="argument-def parameter-def">
<tr>
<th scope="row" class="argument-name"><code>rangeType</code></th>
<td><p>The range type to get the tuning parameters for.</p></td>
</tr>
</table>
</div>
<div class="method-subsection return">
<h4 class="method-subtitle parameter-title">Return Value</h4>
<p>A tuning parameter value for the given range type in full mode.</p>
</div>
<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<p><code class="declared-in-ref">ASCollectionView.h</code></p>
</div>
</div>
</div>
</div><div class="section-method">
<a name="//api/name/setTuningParameters:forRangeType:" title="setTuningParameters:forRangeType:"></a>
<h3 class="method-title"><code><a href="#//api/name/setTuningParameters:forRangeType:">&ndash;&nbsp;setTuningParameters:forRangeType:</a></code>
</h3>
<div class="method-info">
<div class="pointy-thing"></div>
<div class="method-info-container">
<div class="method-subsection brief-description">
<p>Set the tuning parameters for a range type in full mode.</p>
</div>
<div class="method-subsection method-declaration"><code>- (void)setTuningParameters:(ASRangeTuningParameters)<em>tuningParameters</em> forRangeType:(ASLayoutRangeType)<em>rangeType</em></code></div>
<div class="method-subsection arguments-section parameters">
<h4 class="method-subtitle parameter-title">Parameters</h4>
<table class="argument-def parameter-def">
<tr>
<th scope="row" class="argument-name"><code>tuningParameters</code></th>
<td><p>The tuning parameters to store for a range type.</p></td>
</tr>
<tr>
<th scope="row" class="argument-name"><code>rangeType</code></th>
<td><p>The range type to set the tuning parameters for.</p></td>
</tr>
</table>
</div>
<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<p><code class="declared-in-ref">ASCollectionView.h</code></p>
</div>
</div>
</div>
</div><div class="section-method">
<a name="//api/name/tuningParametersForRangeMode:rangeType:" title="tuningParametersForRangeMode:rangeType:"></a>
<h3 class="method-title"><code><a href="#//api/name/tuningParametersForRangeMode:rangeType:">&ndash;&nbsp;tuningParametersForRangeMode:rangeType:</a></code>
</h3>
<div class="method-info">
<div class="pointy-thing"></div>
<div class="method-info-container">
<div class="method-subsection brief-description">
<p>Tuning parameters for a range type in the specified mode.</p>
</div>
<div class="method-subsection method-declaration"><code>- (ASRangeTuningParameters)tuningParametersForRangeMode:(ASLayoutRangeMode)<em>rangeMode</em> rangeType:(ASLayoutRangeType)<em>rangeType</em></code></div>
<div class="method-subsection arguments-section parameters">
<h4 class="method-subtitle parameter-title">Parameters</h4>
<table class="argument-def parameter-def">
<tr>
<th scope="row" class="argument-name"><code>rangeMode</code></th>
<td><p>The range mode to get the running parameters for.</p></td>
</tr>
<tr>
<th scope="row" class="argument-name"><code>rangeType</code></th>
<td><p>The range type to get the tuning parameters for.</p></td>
</tr>
</table>
</div>
<div class="method-subsection return">
<h4 class="method-subtitle parameter-title">Return Value</h4>
<p>A tuning parameter value for the given range type in the given mode.</p>
</div>
<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<p><code class="declared-in-ref">ASCollectionView.h</code></p>
</div>
</div>
</div>
</div><div class="section-method">
<a name="//api/name/setTuningParameters:forRangeMode:rangeType:" title="setTuningParameters:forRangeMode:rangeType:"></a>
<h3 class="method-title"><code><a href="#//api/name/setTuningParameters:forRangeMode:rangeType:">&ndash;&nbsp;setTuningParameters:forRangeMode:rangeType:</a></code>
</h3>
<div class="method-info">
<div class="pointy-thing"></div>
<div class="method-info-container">
<div class="method-subsection brief-description">
<p>Set the tuning parameters for a range type in the specified mode.</p>
</div>
<div class="method-subsection method-declaration"><code>- (void)setTuningParameters:(ASRangeTuningParameters)<em>tuningParameters</em> forRangeMode:(ASLayoutRangeMode)<em>rangeMode</em> rangeType:(ASLayoutRangeType)<em>rangeType</em></code></div>
<div class="method-subsection arguments-section parameters">
<h4 class="method-subtitle parameter-title">Parameters</h4>
<table class="argument-def parameter-def">
<tr>
<th scope="row" class="argument-name"><code>tuningParameters</code></th>
<td><p>The tuning parameters to store for a range type.</p></td>
</tr>
<tr>
<th scope="row" class="argument-name"><code>rangeMode</code></th>
<td><p>The range mode to set the running parameters for.</p></td>
</tr>
<tr>
<th scope="row" class="argument-name"><code>rangeType</code></th>
<td><p>The range type to set the tuning parameters for.</p></td>
</tr>
</table>
</div>
<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<p><code class="declared-in-ref">ASCollectionView.h</code></p>
</div>
</div>
</div>
</div><div class="section-method">
<a name="//api/name/leadingScreensForBatching" title="leadingScreensForBatching"></a>
<h3 class="method-title"><code><a href="#//api/name/leadingScreensForBatching">&nbsp;&nbsp;leadingScreensForBatching</a></code>
</h3>
<div class="method-info">
<div class="pointy-thing"></div>
<div class="method-info-container">
<div class="method-subsection brief-description">
<p>The number of screens left to scroll before the delegate -collectionView:beginBatchFetchingWithContext: is called.</p>
</div>
<div class="method-subsection method-declaration"><code>@property (nonatomic, assign) CGFloat leadingScreensForBatching</code></div>
<div class="method-subsection discussion-section">
<h4 class="method-subtitle">Discussion</h4>
<p>Defaults to two screenfuls.</p>
</div>
<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<p><code class="declared-in-ref">ASCollectionView.h</code></p>
</div>
</div>
</div>
</div><div class="section-method">
<a name="//api/name/layoutInspector" title="layoutInspector"></a>
<h3 class="method-title"><code><a href="#//api/name/layoutInspector">&nbsp;&nbsp;layoutInspector</a></code>
</h3>
<div class="method-info">
<div class="pointy-thing"></div>
<div class="method-info-container">
<div class="method-subsection brief-description">
<p>Optional introspection object for the collection view&rsquo;s layout.</p>
</div>
<div class="method-subsection method-declaration"><code>@property (nonatomic, weak) id&lt;ASCollectionViewLayoutInspecting&gt; layoutInspector</code></div>
<div class="method-subsection discussion-section">
<h4 class="method-subtitle">Discussion</h4>
<p>Since supplementary and decoration views are controlled by the collection view&rsquo;s layout, this object
is used as a bridge to provide information to the internal data controller about the existence of these views and
their associated index paths. For collection views using <code>UICollectionViewFlowLayout</code>, a default inspector
implementation <code>ASCollectionViewFlowLayoutInspector</code> is created and set on this property by default. Custom
collection view layout subclasses will need to provide their own implementation of an inspector object for their
supplementary views to be compatible with <code>ASCollectionView</code>&rsquo;s supplementary node support.</p>
</div>
<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<p><code class="declared-in-ref">ASCollectionView.h</code></p>
</div>
</div>
</div>
</div><div class="section-method">
<a name="//api/name/performBatchAnimated:updates:completion:" title="performBatchAnimated:updates:completion:"></a>
<h3 class="method-title"><code><a href="#//api/name/performBatchAnimated:updates:completion:">&ndash;&nbsp;performBatchAnimated:updates:completion:</a></code>
</h3>
<div class="method-info">
<div class="pointy-thing"></div>
<div class="method-info-container">
<div class="method-subsection brief-description">
<p>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.</p>
</div>
<div class="method-subsection method-declaration"><code>- (void)performBatchAnimated:(BOOL)<em>animated</em> updates:(void ( ^ _Nullable ) ( ))<em>updates</em> completion:(void ( ^ _Nullable ) ( BOOL ))<em>completion</em></code></div>
<div class="method-subsection arguments-section parameters">
<h4 class="method-subtitle parameter-title">Parameters</h4>
<table class="argument-def parameter-def">
<tr>
<th scope="row" class="argument-name"><code>animated</code></th>
<td><p>NO to disable animations for this batch</p></td>
</tr>
<tr>
<th scope="row" class="argument-name"><code>updates</code></th>
<td><p>The block that performs the relevant insert, delete, reload, or move operations.</p></td>
</tr>
<tr>
<th scope="row" class="argument-name"><code>completion</code></th>
<td><p>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.</p></td>
</tr>
</table>
</div>
<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<p><code class="declared-in-ref">ASCollectionView.h</code></p>
</div>
</div>
</div>
</div><div class="section-method">
<a name="//api/name/performBatchUpdates:completion:" title="performBatchUpdates:completion:"></a>
<h3 class="method-title"><code><a href="#//api/name/performBatchUpdates:completion:">&ndash;&nbsp;performBatchUpdates:completion:</a></code>
</h3>
<div class="method-info">
<div class="pointy-thing"></div>
<div class="method-info-container">
<div class="method-subsection brief-description">
<p>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.</p>
</div>
<div class="method-subsection method-declaration"><code>- (void)performBatchUpdates:(void ( ^ _Nullable ) ( ))<em>updates</em> completion:(void ( ^ _Nullable ) ( BOOL ))<em>completion</em></code></div>
<div class="method-subsection arguments-section parameters">
<h4 class="method-subtitle parameter-title">Parameters</h4>
<table class="argument-def parameter-def">
<tr>
<th scope="row" class="argument-name"><code>updates</code></th>
<td><p>The block that performs the relevant insert, delete, reload, or move operations.</p></td>
</tr>
<tr>
<th scope="row" class="argument-name"><code>completion</code></th>
<td><p>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.</p></td>
</tr>
</table>
</div>
<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<p><code class="declared-in-ref">ASCollectionView.h</code></p>
</div>
</div>
</div>
</div><div class="section-method">
<a name="//api/name/reloadDataWithCompletion:" title="reloadDataWithCompletion:"></a>
<h3 class="method-title"><code><a href="#//api/name/reloadDataWithCompletion:">&ndash;&nbsp;reloadDataWithCompletion:</a></code>
</h3>
<div class="method-info">
<div class="pointy-thing"></div>
<div class="method-info-container">
<div class="method-subsection brief-description">
<p>Reload everything from scratch, destroying the working range and all cached nodes.</p>
</div>
<div class="method-subsection method-declaration"><code>- (void)reloadDataWithCompletion:(void ( ^ _Nullable ) ( ))<em>completion</em></code></div>
<div class="method-subsection arguments-section parameters">
<h4 class="method-subtitle parameter-title">Parameters</h4>
<table class="argument-def parameter-def">
<tr>
<th scope="row" class="argument-name"><code>completion</code></th>
<td><p>block to run on completion of asynchronous loading or nil. If supplied, the block is run on
the main thread.</p></td>
</tr>
</table>
</div>
<div class="method-subsection discussion-section">
<h4 class="method-subtitle">Discussion</h4>
<div class="warning"><p><strong>Warning:</strong> This method is substantially more expensive than UICollectionView&rsquo;s version.</p></div>
</div>
<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<p><code class="declared-in-ref">ASCollectionView.h</code></p>
</div>
</div>
</div>
</div><div class="section-method">
<a name="//api/name/reloadData" title="reloadData"></a>
<h3 class="method-title"><code><a href="#//api/name/reloadData">&ndash;&nbsp;reloadData</a></code>
</h3>
<div class="method-info">
<div class="pointy-thing"></div>
<div class="method-info-container">
<div class="method-subsection brief-description">
<p>Reload everything from scratch, destroying the working range and all cached nodes.</p>
</div>
<div class="method-subsection method-declaration"><code>- (void)reloadData</code></div>
<div class="method-subsection discussion-section">
<h4 class="method-subtitle">Discussion</h4>
<div class="warning"><p><strong>Warning:</strong> This method is substantially more expensive than UICollectionView&rsquo;s version.</p></div>
</div>
<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<p><code class="declared-in-ref">ASCollectionView.h</code></p>
</div>
</div>
</div>
</div><div class="section-method">
<a name="//api/name/reloadDataImmediately" title="reloadDataImmediately"></a>
<h3 class="method-title"><code><a href="#//api/name/reloadDataImmediately">&ndash;&nbsp;reloadDataImmediately</a></code>
</h3>
<div class="method-info">
<div class="pointy-thing"></div>
<div class="method-info-container">
<div class="method-subsection brief-description">
<p>Reload everything from scratch entirely on the main thread, destroying the working range and all cached nodes.</p>
</div>
<div class="method-subsection method-declaration"><code>- (void)reloadDataImmediately</code></div>
<div class="method-subsection discussion-section">
<h4 class="method-subtitle">Discussion</h4>
<div class="warning"><p><strong>Warning:</strong> This method is substantially more expensive than UICollectionView&rsquo;s version and will block the main thread
while all the cells load.</p></div>
</div>
<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<p><code class="declared-in-ref">ASCollectionView.h</code></p>
</div>
</div>
</div>
</div><div class="section-method">
<a name="//api/name/relayoutItems" title="relayoutItems"></a>
<h3 class="method-title"><code><a href="#//api/name/relayoutItems">&ndash;&nbsp;relayoutItems</a></code>
</h3>
<div class="method-info">
<div class="pointy-thing"></div>
<div class="method-info-container">
<div class="method-subsection brief-description">
<p>Triggers a relayout of all nodes.</p>
</div>
<div class="method-subsection method-declaration"><code>- (void)relayoutItems</code></div>
<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<p><code class="declared-in-ref">ASCollectionView.h</code></p>
</div>
</div>
</div>
</div><div class="section-method">
<a name="//api/name/waitUntilAllUpdatesAreCommitted" title="waitUntilAllUpdatesAreCommitted"></a>
<h3 class="method-title"><code><a href="#//api/name/waitUntilAllUpdatesAreCommitted">&ndash;&nbsp;waitUntilAllUpdatesAreCommitted</a></code>
</h3>
<div class="method-info">
<div class="pointy-thing"></div>
<div class="method-info-container">
<div class="method-subsection brief-description">
<p>Blocks execution of the main thread until all section and row updates are committed. This method must be called from the main thread.</p>
</div>
<div class="method-subsection method-declaration"><code>- (void)waitUntilAllUpdatesAreCommitted</code></div>
<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<p><code class="declared-in-ref">ASCollectionView.h</code></p>
</div>
</div>
</div>
</div><div class="section-method">
<a name="//api/name/registerSupplementaryNodeOfKind:" title="registerSupplementaryNodeOfKind:"></a>
<h3 class="method-title"><code><a href="#//api/name/registerSupplementaryNodeOfKind:">&ndash;&nbsp;registerSupplementaryNodeOfKind:</a></code>
</h3>
<div class="method-info">
<div class="pointy-thing"></div>
<div class="method-info-container">
<div class="method-subsection brief-description">
<p>Registers the given kind of supplementary node for use in creating node-backed supplementary views.</p>
</div>
<div class="method-subsection method-declaration"><code>- (void)registerSupplementaryNodeOfKind:(NSString *)<em>elementKind</em></code></div>
<div class="method-subsection arguments-section parameters">
<h4 class="method-subtitle parameter-title">Parameters</h4>
<table class="argument-def parameter-def">
<tr>
<th scope="row" class="argument-name"><code>elementKind</code></th>
<td><p>The kind of supplementary node that will be requested through the data source.</p></td>
</tr>
</table>
</div>
<div class="method-subsection discussion-section">
<h4 class="method-subtitle">Discussion</h4>
<p>Use this method to register support for the use of supplementary nodes in place of the default
<code>registerClass:forSupplementaryViewOfKind:withReuseIdentifier:</code> and <code>registerNib:forSupplementaryViewOfKind:withReuseIdentifier:</code>
methods. This method will register an internal backing view that will host the contents of the supplementary nodes
returned from the data source.</p>
</div>
<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<p><code class="declared-in-ref">ASCollectionView.h</code></p>
</div>
</div>
</div>
</div><div class="section-method">
<a name="//api/name/insertSections:" title="insertSections:"></a>
<h3 class="method-title"><code><a href="#//api/name/insertSections:">&ndash;&nbsp;insertSections:</a></code>
</h3>
<div class="method-info">
<div class="pointy-thing"></div>
<div class="method-info-container">
<div class="method-subsection brief-description">
<p>Inserts one or more sections.</p>
</div>
<div class="method-subsection method-declaration"><code>- (void)insertSections:(NSIndexSet *)<em>sections</em></code></div>
<div class="method-subsection arguments-section parameters">
<h4 class="method-subtitle parameter-title">Parameters</h4>
<table class="argument-def parameter-def">
<tr>
<th scope="row" class="argument-name"><code>sections</code></th>
<td><p>An index set that specifies the sections to insert.</p></td>
</tr>
</table>
</div>
<div class="method-subsection discussion-section">
<h4 class="method-subtitle">Discussion</h4>
<p>This method must be called from the main thread. The asyncDataSource must be updated to reflect the changes
before this method is called.</p>
</div>
<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<p><code class="declared-in-ref">ASCollectionView.h</code></p>
</div>
</div>
</div>
</div><div class="section-method">
<a name="//api/name/deleteSections:" title="deleteSections:"></a>
<h3 class="method-title"><code><a href="#//api/name/deleteSections:">&ndash;&nbsp;deleteSections:</a></code>
</h3>
<div class="method-info">
<div class="pointy-thing"></div>
<div class="method-info-container">
<div class="method-subsection brief-description">
<p>Deletes one or more sections.</p>
</div>
<div class="method-subsection method-declaration"><code>- (void)deleteSections:(NSIndexSet *)<em>sections</em></code></div>
<div class="method-subsection arguments-section parameters">
<h4 class="method-subtitle parameter-title">Parameters</h4>
<table class="argument-def parameter-def">
<tr>
<th scope="row" class="argument-name"><code>sections</code></th>
<td><p>An index set that specifies the sections to delete.</p></td>
</tr>
</table>
</div>
<div class="method-subsection discussion-section">
<h4 class="method-subtitle">Discussion</h4>
<p>This method must be called from the main thread. The asyncDataSource must be updated to reflect the changes
before this method is called.</p>
</div>
<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<p><code class="declared-in-ref">ASCollectionView.h</code></p>
</div>
</div>
</div>
</div><div class="section-method">
<a name="//api/name/reloadSections:" title="reloadSections:"></a>
<h3 class="method-title"><code><a href="#//api/name/reloadSections:">&ndash;&nbsp;reloadSections:</a></code>
</h3>
<div class="method-info">
<div class="pointy-thing"></div>
<div class="method-info-container">
<div class="method-subsection brief-description">
<p>Reloads the specified sections.</p>
</div>
<div class="method-subsection method-declaration"><code>- (void)reloadSections:(NSIndexSet *)<em>sections</em></code></div>
<div class="method-subsection arguments-section parameters">
<h4 class="method-subtitle parameter-title">Parameters</h4>
<table class="argument-def parameter-def">
<tr>
<th scope="row" class="argument-name"><code>sections</code></th>
<td><p>An index set that specifies the sections to reload.</p></td>
</tr>
</table>
</div>
<div class="method-subsection discussion-section">
<h4 class="method-subtitle">Discussion</h4>
<p>This method must be called from the main thread. The asyncDataSource must be updated to reflect the changes
before this method is called.</p>
</div>
<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<p><code class="declared-in-ref">ASCollectionView.h</code></p>
</div>
</div>
</div>
</div><div class="section-method">
<a name="//api/name/moveSection:toSection:" title="moveSection:toSection:"></a>
<h3 class="method-title"><code><a href="#//api/name/moveSection:toSection:">&ndash;&nbsp;moveSection:toSection:</a></code>
</h3>
<div class="method-info">
<div class="pointy-thing"></div>
<div class="method-info-container">
<div class="method-subsection brief-description">
<p>Moves a section to a new location.</p>
</div>
<div class="method-subsection method-declaration"><code>- (void)moveSection:(NSInteger)<em>section</em> toSection:(NSInteger)<em>newSection</em></code></div>
<div class="method-subsection arguments-section parameters">
<h4 class="method-subtitle parameter-title">Parameters</h4>
<table class="argument-def parameter-def">
<tr>
<th scope="row" class="argument-name"><code>section</code></th>
<td><p>The index of the section to move.</p></td>
</tr>
<tr>
<th scope="row" class="argument-name"><code>newSection</code></th>
<td><p>The index that is the destination of the move for the section.</p></td>
</tr>
</table>
</div>
<div class="method-subsection discussion-section">
<h4 class="method-subtitle">Discussion</h4>
<p>This method must be called from the main thread. The asyncDataSource must be updated to reflect the changes
before this method is called.</p>
</div>
<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<p><code class="declared-in-ref">ASCollectionView.h</code></p>
</div>
</div>
</div>
</div><div class="section-method">
<a name="//api/name/insertItemsAtIndexPaths:" title="insertItemsAtIndexPaths:"></a>
<h3 class="method-title"><code><a href="#//api/name/insertItemsAtIndexPaths:">&ndash;&nbsp;insertItemsAtIndexPaths:</a></code>
</h3>
<div class="method-info">
<div class="pointy-thing"></div>
<div class="method-info-container">
<div class="method-subsection brief-description">
<p>Inserts items at the locations identified by an array of index paths.</p>
</div>
<div class="method-subsection method-declaration"><code>- (void)insertItemsAtIndexPaths:(NSArray&lt;NSIndexPath*&gt; *)<em>indexPaths</em></code></div>
<div class="method-subsection arguments-section parameters">
<h4 class="method-subtitle parameter-title">Parameters</h4>
<table class="argument-def parameter-def">
<tr>
<th scope="row" class="argument-name"><code>indexPaths</code></th>
<td><p>An array of NSIndexPath objects, each representing an item index and section index that together identify an item.</p></td>
</tr>
</table>
</div>
<div class="method-subsection discussion-section">
<h4 class="method-subtitle">Discussion</h4>
<p>This method must be called from the main thread. The asyncDataSource must be updated to reflect the changes
before this method is called.</p>
</div>
<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<p><code class="declared-in-ref">ASCollectionView.h</code></p>
</div>
</div>
</div>
</div><div class="section-method">
<a name="//api/name/deleteItemsAtIndexPaths:" title="deleteItemsAtIndexPaths:"></a>
<h3 class="method-title"><code><a href="#//api/name/deleteItemsAtIndexPaths:">&ndash;&nbsp;deleteItemsAtIndexPaths:</a></code>
</h3>
<div class="method-info">
<div class="pointy-thing"></div>
<div class="method-info-container">
<div class="method-subsection brief-description">
<p>Deletes the items specified by an array of index paths.</p>
</div>
<div class="method-subsection method-declaration"><code>- (void)deleteItemsAtIndexPaths:(NSArray&lt;NSIndexPath*&gt; *)<em>indexPaths</em></code></div>
<div class="method-subsection arguments-section parameters">
<h4 class="method-subtitle parameter-title">Parameters</h4>
<table class="argument-def parameter-def">
<tr>
<th scope="row" class="argument-name"><code>indexPaths</code></th>
<td><p>An array of NSIndexPath objects identifying the items to delete.</p></td>
</tr>
</table>
</div>
<div class="method-subsection discussion-section">
<h4 class="method-subtitle">Discussion</h4>
<p>This method must be called from the main thread. The asyncDataSource must be updated to reflect the changes
before this method is called.</p>
</div>
<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<p><code class="declared-in-ref">ASCollectionView.h</code></p>
</div>
</div>
</div>
</div><div class="section-method">
<a name="//api/name/reloadItemsAtIndexPaths:" title="reloadItemsAtIndexPaths:"></a>
<h3 class="method-title"><code><a href="#//api/name/reloadItemsAtIndexPaths:">&ndash;&nbsp;reloadItemsAtIndexPaths:</a></code>
</h3>
<div class="method-info">
<div class="pointy-thing"></div>
<div class="method-info-container">
<div class="method-subsection brief-description">
<p>Reloads the specified items.</p>
</div>
<div class="method-subsection method-declaration"><code>- (void)reloadItemsAtIndexPaths:(NSArray&lt;NSIndexPath*&gt; *)<em>indexPaths</em></code></div>
<div class="method-subsection arguments-section parameters">
<h4 class="method-subtitle parameter-title">Parameters</h4>
<table class="argument-def parameter-def">
<tr>
<th scope="row" class="argument-name"><code>indexPaths</code></th>
<td><p>An array of NSIndexPath objects identifying the items to reload.</p></td>
</tr>
</table>
</div>
<div class="method-subsection discussion-section">
<h4 class="method-subtitle">Discussion</h4>
<p>This method must be called from the main thread. The asyncDataSource must be updated to reflect the changes
before this method is called.</p>
</div>
<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<p><code class="declared-in-ref">ASCollectionView.h</code></p>
</div>
</div>
</div>
</div><div class="section-method">
<a name="//api/name/moveItemAtIndexPath:toIndexPath:" title="moveItemAtIndexPath:toIndexPath:"></a>
<h3 class="method-title"><code><a href="#//api/name/moveItemAtIndexPath:toIndexPath:">&ndash;&nbsp;moveItemAtIndexPath:toIndexPath:</a></code>
</h3>
<div class="method-info">
<div class="pointy-thing"></div>
<div class="method-info-container">
<div class="method-subsection brief-description">
<p>Moves the item at a specified location to a destination location.</p>
</div>
<div class="method-subsection method-declaration"><code>- (void)moveItemAtIndexPath:(NSIndexPath *)<em>indexPath</em> toIndexPath:(NSIndexPath *)<em>newIndexPath</em></code></div>
<div class="method-subsection arguments-section parameters">
<h4 class="method-subtitle parameter-title">Parameters</h4>
<table class="argument-def parameter-def">
<tr>
<th scope="row" class="argument-name"><code>indexPath</code></th>
<td><p>The index path identifying the item to move.</p></td>
</tr>
<tr>
<th scope="row" class="argument-name"><code>newIndexPath</code></th>
<td><p>The index path that is the destination of the move for the item.</p></td>
</tr>
</table>
</div>
<div class="method-subsection discussion-section">
<h4 class="method-subtitle">Discussion</h4>
<p>This method must be called from the main thread. The asyncDataSource must be updated to reflect the changes
before this method is called.</p>
</div>
<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<p><code class="declared-in-ref">ASCollectionView.h</code></p>
</div>
</div>
</div>
</div><div class="section-method">
<a name="//api/name/nodeForItemAtIndexPath:" title="nodeForItemAtIndexPath:"></a>
<h3 class="method-title"><code><a href="#//api/name/nodeForItemAtIndexPath:">&ndash;&nbsp;nodeForItemAtIndexPath:</a></code>
</h3>
<div class="method-info">
<div class="pointy-thing"></div>
<div class="method-info-container">
<div class="method-subsection brief-description">
<p>Similar to -cellForItemAtIndexPath:.</p>
</div>
<div class="method-subsection method-declaration"><code>- (nullable ASCellNode *)nodeForItemAtIndexPath:(NSIndexPath *)<em>indexPath</em></code></div>
<div class="method-subsection arguments-section parameters">
<h4 class="method-subtitle parameter-title">Parameters</h4>
<table class="argument-def parameter-def">
<tr>
<th scope="row" class="argument-name"><code>indexPath</code></th>
<td><p>The index path of the requested node.</p></td>
</tr>
</table>
</div>
<div class="method-subsection return">
<h4 class="method-subtitle parameter-title">Return Value</h4>
<p>a node for display at this indexpath or nil</p>
</div>
<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<p><code class="declared-in-ref">ASCollectionView.h</code></p>
</div>
</div>
</div>
</div><div class="section-method">
<a name="//api/name/supplementaryNodeForElementKind:atIndexPath:" title="supplementaryNodeForElementKind:atIndexPath:"></a>
<h3 class="method-title"><code><a href="#//api/name/supplementaryNodeForElementKind:atIndexPath:">&ndash;&nbsp;supplementaryNodeForElementKind:atIndexPath:</a></code>
</h3>
<div class="method-info">
<div class="pointy-thing"></div>
<div class="method-info-container">
<div class="method-subsection brief-description">
<p>Similar to -supplementaryViewForElementKind:atIndexPath:</p>
</div>
<div class="method-subsection method-declaration"><code>- (nullable ASCellNode *)supplementaryNodeForElementKind:(NSString *)<em>elementKind</em> atIndexPath:(NSIndexPath *)<em>indexPath</em></code></div>
<div class="method-subsection arguments-section parameters">
<h4 class="method-subtitle parameter-title">Parameters</h4>
<table class="argument-def parameter-def">
<tr>
<th scope="row" class="argument-name"><code>elementKind</code></th>
<td><p>The kind of supplementary node to locate.</p></td>
</tr>
<tr>
<th scope="row" class="argument-name"><code>indexPath</code></th>
<td><p>The index path of the requested supplementary node.</p></td>
</tr>
</table>
</div>
<div class="method-subsection return">
<h4 class="method-subtitle parameter-title">Return Value</h4>
<p>The specified supplementary node or nil</p>
</div>
<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<p><code class="declared-in-ref">ASCollectionView.h</code></p>
</div>
</div>
</div>
</div><div class="section-method">
<a name="//api/name/indexPathForNode:" title="indexPathForNode:"></a>
<h3 class="method-title"><code><a href="#//api/name/indexPathForNode:">&ndash;&nbsp;indexPathForNode:</a></code>
</h3>
<div class="method-info">
<div class="pointy-thing"></div>
<div class="method-info-container">
<div class="method-subsection brief-description">
<p>Similar to -indexPathForCell:.</p>
</div>
<div class="method-subsection method-declaration"><code>- (NSIndexPath *)indexPathForNode:(ASCellNode *)<em>cellNode</em></code></div>
<div class="method-subsection arguments-section parameters">
<h4 class="method-subtitle parameter-title">Parameters</h4>
<table class="argument-def parameter-def">
<tr>
<th scope="row" class="argument-name"><code>cellNode</code></th>
<td><p>a cellNode part of the table view</p></td>
</tr>
</table>
</div>
<div class="method-subsection return">
<h4 class="method-subtitle parameter-title">Return Value</h4>
<p>an indexPath for this cellNode</p>
</div>
<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<p><code class="declared-in-ref">ASCollectionView.h</code></p>
</div>
</div>
</div>
</div><div class="section-method">
<a name="//api/name/visibleNodes" title="visibleNodes"></a>
<h3 class="method-title"><code><a href="#//api/name/visibleNodes">&ndash;&nbsp;visibleNodes</a></code>
</h3>
<div class="method-info">
<div class="pointy-thing"></div>
<div class="method-info-container">
<div class="method-subsection brief-description">
<p>Similar to -visibleCells.</p>
</div>
<div class="method-subsection method-declaration"><code>- (NSArray&lt;ASCellNode*&gt; *)visibleNodes</code></div>
<div class="method-subsection return">
<h4 class="method-subtitle parameter-title">Return Value</h4>
<p>an array containing the nodes being displayed on screen.</p>
</div>
<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<p><code class="declared-in-ref">ASCollectionView.h</code></p>
</div>
</div>
</div>
</div><div class="section-method">
<a name="//api/name/calculatedSizeForNodeAtIndexPath:" title="calculatedSizeForNodeAtIndexPath:"></a>
<h3 class="method-title"><code><a href="#//api/name/calculatedSizeForNodeAtIndexPath:">&ndash;&nbsp;calculatedSizeForNodeAtIndexPath:</a></code>
</h3>
<div class="method-info">
<div class="pointy-thing"></div>
<div class="method-info-container">
<div class="method-subsection brief-description">
<p>Query the sized node at <code>indexPath</code> for its calculatedSize.</p>
</div>
<div class="method-subsection method-declaration"><code>- (CGSize)calculatedSizeForNodeAtIndexPath:(NSIndexPath *)<em>indexPath</em></code></div>
<div class="method-subsection arguments-section parameters">
<h4 class="method-subtitle parameter-title">Parameters</h4>
<table class="argument-def parameter-def">
<tr>
<th scope="row" class="argument-name"><code>indexPath</code></th>
<td><p>The index path for the node of interest.</p></td>
</tr>
</table>
</div>
<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<p><code class="declared-in-ref">ASCollectionView.h</code></p>
</div>
</div>
</div>
</div><div class="section-method">
<a name="//api/name/scrollDirection" title="scrollDirection"></a>
<h3 class="method-title"><code><a href="#//api/name/scrollDirection">&ndash;&nbsp;scrollDirection</a></code>
</h3>
<div class="method-info">
<div class="pointy-thing"></div>
<div class="method-info-container">
<div class="method-subsection brief-description">
<p>Determines collection view&rsquo;s current scroll direction. Supports 2-axis collection views.</p>
</div>
<div class="method-subsection method-declaration"><code>- (ASScrollDirection)scrollDirection</code></div>
<div class="method-subsection return">
<h4 class="method-subtitle parameter-title">Return Value</h4>
<p>a bitmask of ASScrollDirection values.</p>
</div>
<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<p><code class="declared-in-ref">ASCollectionView.h</code></p>
</div>
</div>
</div>
</div><div class="section-method">
<a name="//api/name/scrollableDirections" title="scrollableDirections"></a>
<h3 class="method-title"><code><a href="#//api/name/scrollableDirections">&ndash;&nbsp;scrollableDirections</a></code>
</h3>
<div class="method-info">
<div class="pointy-thing"></div>
<div class="method-info-container">
<div class="method-subsection brief-description">
<p>Determines collection view&rsquo;s scrollable directions.</p>
</div>
<div class="method-subsection method-declaration"><code>- (ASScrollDirection)scrollableDirections</code></div>
<div class="method-subsection return">
<h4 class="method-subtitle parameter-title">Return Value</h4>
<p>a bitmask of ASScrollDirection values.</p>
</div>
<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<p><code class="declared-in-ref">ASCollectionView.h</code></p>
</div>
</div>
</div>
</div><div class="section-method">
<a name="//api/name/clearContents" title="clearContents"></a>
<h3 class="method-title"><code><a href="#//api/name/clearContents">&ndash;&nbsp;clearContents</a></code>
</h3>
<div class="method-info">
<div class="pointy-thing"></div>
<div class="method-info-container">
<div class="method-subsection brief-description">
<p>Triggers all loaded ASCellNodes to destroy displayed contents (freeing a lot of memory).</p>
</div>
<div class="method-subsection method-declaration"><code>- (void)clearContents</code></div>
<div class="method-subsection discussion-section">
<h4 class="method-subtitle">Discussion</h4>
<p>This method should only be called by ASCollectionNode. To be removed in a later release.</p>
</div>
<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<p><code class="declared-in-ref">ASCollectionView.h</code></p>
</div>
</div>
</div>
</div><div class="section-method">
<a name="//api/name/clearFetchedData" title="clearFetchedData"></a>
<h3 class="method-title"><code><a href="#//api/name/clearFetchedData">&ndash;&nbsp;clearFetchedData</a></code>
</h3>
<div class="method-info">
<div class="pointy-thing"></div>
<div class="method-info-container">
<div class="method-subsection brief-description">
<p>Triggers all loaded ASCellNodes to purge any data fetched from the network or disk (freeing memory).</p>
</div>
<div class="method-subsection method-declaration"><code>- (void)clearFetchedData</code></div>
<div class="method-subsection discussion-section">
<h4 class="method-subtitle">Discussion</h4>
<p>This method should only be called by ASCollectionNode. To be removed in a later release.</p>
</div>
<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<p><code class="declared-in-ref">ASCollectionView.h</code></p>
</div>
</div>
</div>
</div><div class="section-method">
<a name="//api/name/zeroContentInsets" title="zeroContentInsets"></a>
<h3 class="method-title"><code><a href="#//api/name/zeroContentInsets">&nbsp;&nbsp;zeroContentInsets</a></code>
</h3>
<div class="method-info">
<div class="pointy-thing"></div>
<div class="method-info-container">
<div class="method-subsection brief-description">
<p>Forces the .contentInset to be UIEdgeInsetsZero.</p>
</div>
<div class="method-subsection method-declaration"><code>@property (nonatomic) BOOL zeroContentInsets</code></div>
<div class="method-subsection discussion-section">
<h4 class="method-subtitle">Discussion</h4>
<p>By default, UIKit sets the top inset to the navigation bar height, even for horizontally
scrolling views. This can only be disabled by setting a property on the containing UIViewController,
automaticallyAdjustsScrollViewInsets, which may not be accessible. ASPagerNode uses this to ensure
its flow layout behaves predictably and does not log undefined layout warnings.</p>
</div>
<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<p><code class="declared-in-ref">ASCollectionView.h</code></p>
</div>
</div>
</div>
</div>
</div>
</div>
</main>
<footer>
<div class="footer-copyright">
<p class="copyright">Copyright &copy; 2016 Facebook. All rights reserved. Updated: 2016-07-11</p>
<p class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.2.1 (build 1334)</a>.</p>
</div>
</footer>
</div>
</div>
</article>
<script src="../js/script.js"></script>
</body>
</html>