Files
AsyncDisplayKit/appledoc/Classes/ASRangeController.html
2014-11-17 16:11:53 -08:00

769 lines
20 KiB
HTML

<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="html/html; charset=utf-8" />
<title>ASRangeController Class Reference</title>
<meta id="xcode-display" name="xcode-display" content="render"/>
<link rel="stylesheet" type="text/css" href="../css/styles.css" media="all" />
<link rel="stylesheet" type="text/css" media="print" href="../css/stylesPrint.css" />
<meta name="generator" content="appledoc 2.2 (build 963)" />
</head>
<body>
<header id="top_header">
<div id="library" class="hideInXcode">
<h1><a id="libraryTitle" href="../index.html">AsyncDisplayKit </a></h1>
<a id="developerHome" href="../index.html">Facebook</a>
</div>
<div id="title" role="banner">
<h1 class="hideInXcode">ASRangeController Class Reference</h1>
</div>
<ul id="headerButtons" role="toolbar">
<li id="toc_button">
<button aria-label="Show Table of Contents" role="checkbox" class="open" id="table_of_contents"><span class="disclosure"></span>Table of Contents</button>
</li>
<li id="jumpto_button" role="navigation">
<select id="jumpTo">
<option value="top">Jump To&#133;</option>
<option value="overview">Overview</option>
<option value="tasks">Tasks</option>
<option value="properties">Properties</option>
<option value="//api/name/delegate">&nbsp;&nbsp;&nbsp;&nbsp;delegate</option>
<option value="//api/name/tuningParameters">&nbsp;&nbsp;&nbsp;&nbsp;tuningParameters</option>
<option value="instance_methods">Instance Methods</option>
<option value="//api/name/appendNodesWithIndexPaths:">&nbsp;&nbsp;&nbsp;&nbsp;- appendNodesWithIndexPaths:</option>
<option value="//api/name/calculatedSizeForNodeAtIndexPath:">&nbsp;&nbsp;&nbsp;&nbsp;- calculatedSizeForNodeAtIndexPath:</option>
<option value="//api/name/configureContentView:forIndexPath:">&nbsp;&nbsp;&nbsp;&nbsp;- configureContentView:forIndexPath:</option>
<option value="//api/name/configureTableViewCell:forIndexPath:">&nbsp;&nbsp;&nbsp;&nbsp;- configureTableViewCell:forIndexPath:</option>
<option value="//api/name/numberOfSizedSections">&nbsp;&nbsp;&nbsp;&nbsp;- numberOfSizedSections</option>
<option value="//api/name/rebuildData">&nbsp;&nbsp;&nbsp;&nbsp;- rebuildData</option>
<option value="//api/name/visibleNodeIndexPathsDidChange">&nbsp;&nbsp;&nbsp;&nbsp;- visibleNodeIndexPathsDidChange</option>
</select>
</li>
</ul>
</header>
<nav id="tocContainer" class="isShowingTOC">
<ul id="toc" role="tree">
<li role="treeitem"><span class="nodisclosure"></span><span class="sectionName"><a href="#overview">Overview</a></span></li>
<li role="treeitem" id="task_treeitem"><span class="nodisclosure"></span><span class="sectionName"><a href="#tasks">Tasks</a></span><ul>
</ul></li>
<li role="treeitem" class="children"><span class="disclosure"></span><span class="sectionName"><a href="#properties">Properties</a></span><ul>
<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/delegate">delegate</a></span></li>
<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/tuningParameters">tuningParameters</a></span></li>
</ul></li>
<li role="treeitem" class="children"><span class="disclosure"></span><span class="sectionName"><a href="#instance_methods">Instance Methods</a></span><ul>
<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/appendNodesWithIndexPaths:">appendNodesWithIndexPaths:</a></span></li>
<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/calculatedSizeForNodeAtIndexPath:">calculatedSizeForNodeAtIndexPath:</a></span></li>
<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/configureContentView:forIndexPath:">configureContentView:forIndexPath:</a></span></li>
<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/configureTableViewCell:forIndexPath:">configureTableViewCell:forIndexPath:</a></span></li>
<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/numberOfSizedSections">numberOfSizedSections</a></span></li>
<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/rebuildData">rebuildData</a></span></li>
<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/visibleNodeIndexPathsDidChange">visibleNodeIndexPathsDidChange</a></span></li>
</ul></li>
</ul>
</nav>
<article>
<div id="contents" class="isShowingTOC" role="main">
<a title="ASRangeController Class Reference" name="top"></a>
<div class="main-navigation navigation-top">
<ul>
<li><a href="../index.html">Index</a></li>
<li><a href="../hierarchy.html">Hierarchy</a></li>
</ul>
</div>
<div id="header">
<div class="section-header">
<h1 class="title title-header">ASRangeController Class Reference</h1>
</div>
</div>
<div id="container">
<div class="section section-specification"><table cellspacing="0"><tbody>
<tr>
<td class="specification-title">Inherits from</td>
<td class="specification-value">ASDealloc2MainObject</td>
</tr><tr>
<td class="specification-title">Declared in</td>
<td class="specification-value">ASRangeController.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>Working range controller.</p>
<p>Used internally by ASTableView and potentially by a future ASCollectionView. Observes the visible range, maintains
a working range, and is responsible for handling AsyncDisplayKit machinery (sizing cell nodes, enqueueing and
cancelling their asynchronous layout and display, and so on).</p>
</div>
<div class="section section-tasks">
<a title="Tasks" name="tasks"></a>
<h2 class="subtitle subtitle-tasks">Tasks</h2>
<ul class="task-list">
<li>
<span class="tooltip">
<code><a href="#//api/name/rebuildData">&ndash;&nbsp;rebuildData</a></code>
</span>
</li><li>
<span class="tooltip">
<code><a href="#//api/name/visibleNodeIndexPathsDidChange">&ndash;&nbsp;visibleNodeIndexPathsDidChange</a></code>
</span>
</li><li>
<span class="tooltip">
<code><a href="#//api/name/numberOfSizedSections">&ndash;&nbsp;numberOfSizedSections</a></code>
</span>
</li><li>
<span class="tooltip">
<code><a href="#//api/name/configureTableViewCell:forIndexPath:">&ndash;&nbsp;configureTableViewCell:forIndexPath:</a></code>
</span>
</li><li>
<span class="tooltip">
<code><a href="#//api/name/configureContentView:forIndexPath:">&ndash;&nbsp;configureContentView:forIndexPath:</a></code>
</span>
</li><li>
<span class="tooltip">
<code><a href="#//api/name/calculatedSizeForNodeAtIndexPath:">&ndash;&nbsp;calculatedSizeForNodeAtIndexPath:</a></code>
</span>
</li><li>
<span class="tooltip">
<code><a href="#//api/name/appendNodesWithIndexPaths:">&ndash;&nbsp;appendNodesWithIndexPaths:</a></code>
</span>
</li><li>
<span class="tooltip">
<code><a href="#//api/name/delegate">&nbsp;&nbsp;delegate</a></code>
</span>
<span class="task-item-suffix">property</span>
</li><li>
<span class="tooltip">
<code><a href="#//api/name/tuningParameters">&nbsp;&nbsp;tuningParameters</a></code>
</span>
<span class="task-item-suffix">property</span>
</li>
</ul>
</div>
<div class="section section-methods">
<a title="Properties" name="properties"></a>
<h2 class="subtitle subtitle-methods">Properties</h2>
<div class="section-method">
<a name="//api/name/delegate" title="delegate"></a>
<h3 class="subsubtitle method-title">delegate</h3>
<div class="method-subsection brief-description">
<p>Delegate and ultimate data source. Must not be nil.</p>
</div>
<div class="method-subsection method-declaration"><code>@property (nonatomic, weak) id&lt;ASRangeControllerDelegate&gt; delegate</code></div>
<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<code class="declared-in-ref">ASRangeController.h</code><br />
</div>
</div>
<div class="section-method">
<a name="//api/name/tuningParameters" title="tuningParameters"></a>
<h3 class="subsubtitle method-title">tuningParameters</h3>
<div class="method-subsection brief-description">
<p>Tuning parameters for the working range.</p>
</div>
<div class="method-subsection method-declaration"><code>@property (nonatomic, assign) ASRangeTuningParameters tuningParameters</code></div>
<div class="method-subsection discussion-section">
<h4 class="method-subtitle">Discussion</h4>
<p>Defaults to a trailing buffer of one screenful and a leading buffer of two screenfuls.</p>
</div>
<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<code class="declared-in-ref">ASRangeController.h</code><br />
</div>
</div>
</div>
<div class="section section-methods">
<a title="Instance Methods" name="instance_methods"></a>
<h2 class="subtitle subtitle-methods">Instance Methods</h2>
<div class="section-method">
<a name="//api/name/appendNodesWithIndexPaths:" title="appendNodesWithIndexPaths:"></a>
<h3 class="subsubtitle method-title">appendNodesWithIndexPaths:</h3>
<div class="method-subsection brief-description">
<p>Notify the receiver that its data source has been updated to append the specified nodes.</p>
</div>
<div class="method-subsection method-declaration"><code>- (void)appendNodesWithIndexPaths:(id)<em>indexPaths</em></code></div>
<div class="method-subsection arguments-section parameters">
<h4 class="method-subtitle parameter-title">Parameters</h4>
<dl class="argument-def parameter-def">
<dt><em>indexPaths</em></dt>
<dd><p>Array of NSIndexPaths for the newly-sized nodes.</p></dd>
</dl>
</div>
<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<code class="declared-in-ref">ASRangeController.h</code><br />
</div>
</div>
<div class="section-method">
<a name="//api/name/calculatedSizeForNodeAtIndexPath:" title="calculatedSizeForNodeAtIndexPath:"></a>
<h3 class="subsubtitle method-title">calculatedSizeForNodeAtIndexPath:</h3>
<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:(id)<em>indexPath</em></code></div>
<div class="method-subsection arguments-section parameters">
<h4 class="method-subtitle parameter-title">Parameters</h4>
<dl class="argument-def parameter-def">
<dt><em>indexPath</em></dt>
<dd><p>The index path for the node of interest.</p>
<p>TODO: Currently we disallow direct access to ASCellNode outside ASRangeController since touching the node&rsquo;s view can
break async display. We should expose the node anyway, possibly with an assertion guarding against external
use of the view property, so ASCellNode can support configuration for UITableViewCell properties (selection
style, separator style, etc.) and ASTableView can query that data.</p></dd>
</dl>
</div>
<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<code class="declared-in-ref">ASRangeController.h</code><br />
</div>
</div>
<div class="section-method">
<a name="//api/name/configureContentView:forIndexPath:" title="configureContentView:forIndexPath:"></a>
<h3 class="subsubtitle method-title">configureContentView:forIndexPath:</h3>
<div class="method-subsection brief-description">
<p>Add the sized node for <code>indexPath</code> as a subview of <code>contentView</code>.</p>
</div>
<div class="method-subsection method-declaration"><code>- (void)configureContentView:(id)<em>contentView</em> forIndexPath:(id)<em>indexPath</em></code></div>
<div class="method-subsection arguments-section parameters">
<h4 class="method-subtitle parameter-title">Parameters</h4>
<dl class="argument-def parameter-def">
<dt><em>contentView</em></dt>
<dd><p>UIView to add a (sized) node&rsquo;s view to.</p></dd>
</dl>
<dl class="argument-def parameter-def">
<dt><em>indexPath</em></dt>
<dd><p>Index path for the node to be added.</p></dd>
</dl>
</div>
<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<code class="declared-in-ref">ASRangeController.h</code><br />
</div>
</div>
<div class="section-method">
<a name="//api/name/configureTableViewCell:forIndexPath:" title="configureTableViewCell:forIndexPath:"></a>
<h3 class="subsubtitle method-title">configureTableViewCell:forIndexPath:</h3>
<div class="method-subsection brief-description">
<p>Configure the specified UITableViewCell&rsquo;s content view, and apply properties from ASCellNode.</p>
</div>
<div class="method-subsection method-declaration"><code>- (void)configureTableViewCell:(id)<em>cell</em> forIndexPath:(id)<em>indexPath</em></code></div>
<div class="method-subsection arguments-section parameters">
<h4 class="method-subtitle parameter-title">Parameters</h4>
<dl class="argument-def parameter-def">
<dt><em>cell</em></dt>
<dd><p>UITableViewCell to configure.</p></dd>
</dl>
<dl class="argument-def parameter-def">
<dt><em>indexPath</em></dt>
<dd><p>Index path for the node of interest.</p></dd>
</dl>
</div>
<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<code class="declared-in-ref">ASRangeController.h</code><br />
</div>
</div>
<div class="section-method">
<a name="//api/name/numberOfSizedSections" title="numberOfSizedSections"></a>
<h3 class="subsubtitle method-title">numberOfSizedSections</h3>
<div class="method-subsection brief-description">
<p>ASTableView is only aware of nodes that have already been sized.</p>
</div>
<div class="method-subsection method-declaration"><code>- (NSInteger)numberOfSizedSections</code></div>
<div class="method-subsection discussion-section">
<h4 class="method-subtitle">Discussion</h4>
<p>Custom ASCellNode implementations are encouraged to have &ldquo;realistic placeholders&rdquo;, since they can only be onscreen if
they have enough data for layout. E.g., try setting all subnodes' background colours to [UIColor lightGrayColor].</p>
</div>
<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<code class="declared-in-ref">ASRangeController.h</code><br />
</div>
</div>
<div class="section-method">
<a name="//api/name/rebuildData" title="rebuildData"></a>
<h3 class="subsubtitle method-title">rebuildData</h3>
<div class="method-subsection brief-description">
<p>Notify the receiver that its delegate&rsquo;s data source has been set or changed. This is like -[UITableView reloadData]
but drastically more expensive, as it destroys the working range and all cached nodes.</p>
</div>
<div class="method-subsection method-declaration"><code>- (void)rebuildData</code></div>
<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<code class="declared-in-ref">ASRangeController.h</code><br />
</div>
</div>
<div class="section-method">
<a name="//api/name/visibleNodeIndexPathsDidChange" title="visibleNodeIndexPathsDidChange"></a>
<h3 class="subsubtitle method-title">visibleNodeIndexPathsDidChange</h3>
<div class="method-subsection brief-description">
<p>Notify the receiver that the visible range has been updated.</p>
</div>
<div class="method-subsection method-declaration"><code>- (void)visibleNodeIndexPathsDidChange</code></div>
<div class="method-subsection see-also-section">
<h4 class="method-subtitle">See Also</h4>
<ul>
<li><code><p><a href="../Protocols/ASRangeControllerDelegate.html#//api/name/rangeControllerVisibleNodeIndexPaths:">[ASRangeControllerDelegate rangeControllerVisibleNodeIndexPaths:]</a></p></code></li>
</ul>
</div>
<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<code class="declared-in-ref">ASRangeController.h</code><br />
</div>
</div>
</div>
</div>
<div class="main-navigation navigation-bottom">
<ul>
<li><a href="../index.html">Index</a></li>
<li><a href="../hierarchy.html">Hierarchy</a></li>
</ul>
</div>
<div id="footer">
<hr />
<div class="footer-copyright">
<p><span class="copyright">&copy; 2014 Facebook. All rights reserved. (Last updated: 2014-11-17)</span><br />
<span class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.2 (build 963)</a>.</span></p>
</div>
</div>
</div>
</article>
<script type="text/javascript">
function jumpToChange()
{
window.location.hash = this.options[this.selectedIndex].value;
}
function toggleTOC()
{
var contents = document.getElementById('contents');
var tocContainer = document.getElementById('tocContainer');
if (this.getAttribute('class') == 'open')
{
this.setAttribute('class', '');
contents.setAttribute('class', '');
tocContainer.setAttribute('class', '');
window.name = "hideTOC";
}
else
{
this.setAttribute('class', 'open');
contents.setAttribute('class', 'isShowingTOC');
tocContainer.setAttribute('class', 'isShowingTOC');
window.name = "";
}
return false;
}
function toggleTOCEntryChildren(e)
{
e.stopPropagation();
var currentClass = this.getAttribute('class');
if (currentClass == 'children') {
this.setAttribute('class', 'children open');
}
else if (currentClass == 'children open') {
this.setAttribute('class', 'children');
}
return false;
}
function tocEntryClick(e)
{
e.stopPropagation();
return true;
}
function init()
{
var selectElement = document.getElementById('jumpTo');
selectElement.addEventListener('change', jumpToChange, false);
var tocButton = document.getElementById('table_of_contents');
tocButton.addEventListener('click', toggleTOC, false);
var taskTreeItem = document.getElementById('task_treeitem');
if (taskTreeItem.getElementsByTagName('li').length > 0)
{
taskTreeItem.setAttribute('class', 'children');
taskTreeItem.firstChild.setAttribute('class', 'disclosure');
}
var tocList = document.getElementById('toc');
var tocEntries = tocList.getElementsByTagName('li');
for (var i = 0; i < tocEntries.length; i++) {
tocEntries[i].addEventListener('click', toggleTOCEntryChildren, false);
}
var tocLinks = tocList.getElementsByTagName('a');
for (var i = 0; i < tocLinks.length; i++) {
tocLinks[i].addEventListener('click', tocEntryClick, false);
}
if (window.name == "hideTOC") {
toggleTOC.call(tocButton);
}
}
window.onload = init;
// If showing in Xcode, hide the TOC and Header
if (navigator.userAgent.match(/xcode/i)) {
document.getElementById("contents").className = "hideInXcode"
document.getElementById("tocContainer").className = "hideInXcode"
document.getElementById("top_header").className = "hideInXcode"
}
</script>
</body>
</html>