mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00

git-subtree-dir: submodules/AsyncDisplayKit git-subtree-mainline: d06f423e0ed3df1fed9bd10d79ee312a9179b632 git-subtree-split: 02bedc12816e251ad71777f9d2578329b6d2bef6
762 lines
18 KiB
HTML
Executable File
762 lines
18 KiB
HTML
Executable File
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
|
|
<title>ASLayout 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"> </a>
|
|
</h1>
|
|
|
|
<p id="developer-home">
|
|
<a href="../index.html">AsyncDisplayKit</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…</option>
|
|
|
|
<option value="overview">Overview</option>
|
|
|
|
|
|
|
|
|
|
<option value="tasks">Tasks</option>
|
|
|
|
|
|
|
|
|
|
|
|
<optgroup label="Properties">
|
|
|
|
<option value="//api/name/frame">frame</option>
|
|
|
|
<option value="//api/name/layoutElement">layoutElement</option>
|
|
|
|
<option value="//api/name/position">position</option>
|
|
|
|
<option value="//api/name/size">size</option>
|
|
|
|
<option value="//api/name/sublayouts">sublayouts</option>
|
|
|
|
<option value="//api/name/type">type</option>
|
|
|
|
</optgroup>
|
|
|
|
|
|
|
|
<optgroup label="Class Methods">
|
|
|
|
<option value="//api/name/layoutWithLayout:position:">+ layoutWithLayout:position:</option>
|
|
|
|
<option value="//api/name/layoutWithLayoutElement:size:">+ layoutWithLayoutElement:size:</option>
|
|
|
|
<option value="//api/name/layoutWithLayoutElement:size:position:sublayouts:">+ layoutWithLayoutElement:size:position:sublayouts:</option>
|
|
|
|
<option value="//api/name/layoutWithLayoutElement:size:sublayouts:">+ layoutWithLayoutElement:size:sublayouts:</option>
|
|
|
|
</optgroup>
|
|
|
|
|
|
|
|
<optgroup label="Instance Methods">
|
|
|
|
<option value="//api/name/filteredNodeLayoutTree">- filteredNodeLayoutTree</option>
|
|
|
|
<option value="//api/name/initWithLayoutElement:size:position:sublayouts:">- initWithLayoutElement:size:position:sublayouts:</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">ASLayout Class Reference</h1>
|
|
|
|
|
|
<div class="section section-specification"><table cellspacing="0"><tbody>
|
|
<tr>
|
|
<th>Inherits from</th>
|
|
<td>NSObject</td>
|
|
</tr><tr>
|
|
<th>Declared in</th>
|
|
<td>ASLayout.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>A node in the layout tree that represents the size and position of the object that created it (ASLayoutElement).</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/layoutElement" title="layoutElement"></a>
|
|
<h3 class="method-title"><code><a href="#//api/name/layoutElement"> layoutElement</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 underlying object described by this layout</p>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="method-subsection method-declaration"><code>@property (nonatomic, weak, readonly) id<ASLayoutElement> layoutElement</code></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="method-subsection declared-in-section">
|
|
<h4 class="method-subtitle">Declared In</h4>
|
|
<p><code class="declared-in-ref">ASLayout.h</code></p>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div><div class="section-method">
|
|
<a name="//api/name/type" title="type"></a>
|
|
<h3 class="method-title"><code><a href="#//api/name/type"> type</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 type of ASLayoutElement that created this layout</p>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="method-subsection method-declaration"><code>@property (nonatomic, assign, readonly) ASLayoutElementType type</code></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="method-subsection declared-in-section">
|
|
<h4 class="method-subtitle">Declared In</h4>
|
|
<p><code class="declared-in-ref">ASLayout.h</code></p>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div><div class="section-method">
|
|
<a name="//api/name/size" title="size"></a>
|
|
<h3 class="method-title"><code><a href="#//api/name/size"> size</a></code>
|
|
</h3>
|
|
|
|
<div class="method-info">
|
|
<div class="pointy-thing"></div>
|
|
|
|
<div class="method-info-container">
|
|
|
|
|
|
<div class="method-subsection brief-description">
|
|
<p>Size of the current layout</p>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="method-subsection method-declaration"><code>@property (nonatomic, assign, readonly) CGSize size</code></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="method-subsection declared-in-section">
|
|
<h4 class="method-subtitle">Declared In</h4>
|
|
<p><code class="declared-in-ref">ASLayout.h</code></p>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div><div class="section-method">
|
|
<a name="//api/name/position" title="position"></a>
|
|
<h3 class="method-title"><code><a href="#//api/name/position"> position</a></code>
|
|
</h3>
|
|
|
|
<div class="method-info">
|
|
<div class="pointy-thing"></div>
|
|
|
|
<div class="method-info-container">
|
|
|
|
|
|
<div class="method-subsection brief-description">
|
|
<p>Position in parent. Default to CGPointNull.</p>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="method-subsection method-declaration"><code>@property (nonatomic, assign, readonly) CGPoint position</code></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="method-subsection discussion-section">
|
|
<h4 class="method-subtitle">Discussion</h4>
|
|
<p>When being used as a sublayout, this property must not equal CGPointNull.</p>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="method-subsection declared-in-section">
|
|
<h4 class="method-subtitle">Declared In</h4>
|
|
<p><code class="declared-in-ref">ASLayout.h</code></p>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div><div class="section-method">
|
|
<a name="//api/name/sublayouts" title="sublayouts"></a>
|
|
<h3 class="method-title"><code><a href="#//api/name/sublayouts"> sublayouts</a></code>
|
|
</h3>
|
|
|
|
<div class="method-info">
|
|
<div class="pointy-thing"></div>
|
|
|
|
<div class="method-info-container">
|
|
|
|
|
|
<div class="method-subsection brief-description">
|
|
<p>Array of ASLayouts. Each must have a valid non-null position.</p>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="method-subsection method-declaration"><code>@property (nonatomic, copy, readonly) NSArray<ASLayout*> *sublayouts</code></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="method-subsection declared-in-section">
|
|
<h4 class="method-subtitle">Declared In</h4>
|
|
<p><code class="declared-in-ref">ASLayout.h</code></p>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div><div class="section-method">
|
|
<a name="//api/name/frame" title="frame"></a>
|
|
<h3 class="method-title"><code><a href="#//api/name/frame"> frame</a></code>
|
|
</h3>
|
|
|
|
<div class="method-info">
|
|
<div class="pointy-thing"></div>
|
|
|
|
<div class="method-info-container">
|
|
|
|
|
|
<div class="method-subsection brief-description">
|
|
<p>Returns a valid frame for the current layout computed with the size and position.</p>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="method-subsection method-declaration"><code>@property (nonatomic, assign, readonly) CGRect frame</code></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="method-subsection discussion-section">
|
|
<h4 class="method-subtitle">Discussion</h4>
|
|
<p>Clamps the layout’s origin or position to 0 if any of the calculated values are infinite.</p>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="method-subsection declared-in-section">
|
|
<h4 class="method-subtitle">Declared In</h4>
|
|
<p><code class="declared-in-ref">ASLayout.h</code></p>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div><div class="section-method">
|
|
<a name="//api/name/initWithLayoutElement:size:position:sublayouts:" title="initWithLayoutElement:size:position:sublayouts:"></a>
|
|
<h3 class="method-title"><code><a href="#//api/name/initWithLayoutElement:size:position:sublayouts:">– initWithLayoutElement:size:position:sublayouts:</a></code>
|
|
</h3>
|
|
|
|
<div class="method-info">
|
|
<div class="pointy-thing"></div>
|
|
|
|
<div class="method-info-container">
|
|
|
|
|
|
<div class="method-subsection brief-description">
|
|
<p>Designated initializer</p>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="method-subsection method-declaration"><code>- (instancetype)initWithLayoutElement:(id<ASLayoutElement>)<em>layoutElement</em> size:(CGSize)<em>size</em> position:(CGPoint)<em>position</em> sublayouts:(nullable NSArray<ASLayout*> *)<em>sublayouts</em></code></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="method-subsection declared-in-section">
|
|
<h4 class="method-subtitle">Declared In</h4>
|
|
<p><code class="declared-in-ref">ASLayout.h</code></p>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div><div class="section-method">
|
|
<a name="//api/name/layoutWithLayoutElement:size:position:sublayouts:" title="layoutWithLayoutElement:size:position:sublayouts:"></a>
|
|
<h3 class="method-title"><code><a href="#//api/name/layoutWithLayoutElement:size:position:sublayouts:">+ layoutWithLayoutElement:size:position:sublayouts:</a></code>
|
|
</h3>
|
|
|
|
<div class="method-info">
|
|
<div class="pointy-thing"></div>
|
|
|
|
<div class="method-info-container">
|
|
|
|
|
|
<div class="method-subsection brief-description">
|
|
<p>Convenience class initializer for layout construction.</p>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="method-subsection method-declaration"><code>+ (instancetype)layoutWithLayoutElement:(id<ASLayoutElement>)<em>layoutElement</em> size:(CGSize)<em>size</em> position:(CGPoint)<em>position</em> sublayouts:(nullable NSArray<ASLayout*> *)<em>sublayouts</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>layoutElement</code></th>
|
|
<td><p>The backing ASLayoutElement object.</p></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th scope="row" class="argument-name"><code>size</code></th>
|
|
<td><p>The size of this layout.</p></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th scope="row" class="argument-name"><code>position</code></th>
|
|
<td><p>The position of this layout within its parent (if available).</p></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th scope="row" class="argument-name"><code>sublayouts</code></th>
|
|
<td><p>Sublayouts belong to the new layout.</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">ASLayout.h</code></p>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div><div class="section-method">
|
|
<a name="//api/name/layoutWithLayoutElement:size:sublayouts:" title="layoutWithLayoutElement:size:sublayouts:"></a>
|
|
<h3 class="method-title"><code><a href="#//api/name/layoutWithLayoutElement:size:sublayouts:">+ layoutWithLayoutElement:size:sublayouts:</a></code>
|
|
</h3>
|
|
|
|
<div class="method-info">
|
|
<div class="pointy-thing"></div>
|
|
|
|
<div class="method-info-container">
|
|
|
|
|
|
<div class="method-subsection brief-description">
|
|
<p>Convenience initializer that has CGPointNull position.
|
|
Best used by ASDisplayNode subclasses that are manually creating a layout for -calculateLayoutThatFits:,
|
|
or for ASLayoutSpec subclasses that are referencing the “self” level in the layout tree,
|
|
or for creating a sublayout of which the position is yet to be determined.</p>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="method-subsection method-declaration"><code>+ (instancetype)layoutWithLayoutElement:(id<ASLayoutElement>)<em>layoutElement</em> size:(CGSize)<em>size</em> sublayouts:(nullable NSArray<ASLayout*> *)<em>sublayouts</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>layoutElement</code></th>
|
|
<td><p>The backing ASLayoutElement object.</p></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th scope="row" class="argument-name"><code>size</code></th>
|
|
<td><p>The size of this layout.</p></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th scope="row" class="argument-name"><code>sublayouts</code></th>
|
|
<td><p>Sublayouts belong to the new layout.</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">ASLayout.h</code></p>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div><div class="section-method">
|
|
<a name="//api/name/layoutWithLayoutElement:size:" title="layoutWithLayoutElement:size:"></a>
|
|
<h3 class="method-title"><code><a href="#//api/name/layoutWithLayoutElement:size:">+ layoutWithLayoutElement:size:</a></code>
|
|
</h3>
|
|
|
|
<div class="method-info">
|
|
<div class="pointy-thing"></div>
|
|
|
|
<div class="method-info-container">
|
|
|
|
|
|
<div class="method-subsection brief-description">
|
|
<p>Convenience that has CGPointNull position and no sublayouts.
|
|
Best used for creating a layout that has no sublayouts, and is either a root one
|
|
or a sublayout of which the position is yet to be determined.</p>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="method-subsection method-declaration"><code>+ (instancetype)layoutWithLayoutElement:(id<ASLayoutElement>)<em>layoutElement</em> size:(CGSize)<em>size</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>layoutElement</code></th>
|
|
<td><p>The backing ASLayoutElement object.</p></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th scope="row" class="argument-name"><code>size</code></th>
|
|
<td><p>The size of this layout.</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">ASLayout.h</code></p>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div><div class="section-method">
|
|
<a name="//api/name/layoutWithLayout:position:" title="layoutWithLayout:position:"></a>
|
|
<h3 class="method-title"><code><a href="#//api/name/layoutWithLayout:position:">+ layoutWithLayout:position:</a></code>
|
|
</h3>
|
|
|
|
<div class="method-info">
|
|
<div class="pointy-thing"></div>
|
|
|
|
<div class="method-info-container">
|
|
|
|
|
|
<div class="method-subsection brief-description">
|
|
<p>Convenience initializer that creates a layout based on the values of the given layout, with a new position</p>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="method-subsection method-declaration"><code>+ (instancetype)layoutWithLayout:(ASLayout *)<em>layout</em> position:(CGPoint)<em>position</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 to use to create the new layout</p></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th scope="row" class="argument-name"><code>position</code></th>
|
|
<td><p>The position of the new layout</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">ASLayout.h</code></p>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div><div class="section-method">
|
|
<a name="//api/name/filteredNodeLayoutTree" title="filteredNodeLayoutTree"></a>
|
|
<h3 class="method-title"><code><a href="#//api/name/filteredNodeLayoutTree">– filteredNodeLayoutTree</a></code>
|
|
</h3>
|
|
|
|
<div class="method-info">
|
|
<div class="pointy-thing"></div>
|
|
|
|
<div class="method-info-container">
|
|
|
|
|
|
<div class="method-subsection brief-description">
|
|
<p>Traverses the existing layout tree and generates a new tree that represents only ASDisplayNode layouts</p>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="method-subsection method-declaration"><code>- (ASLayout *)filteredNodeLayoutTree</code></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="method-subsection declared-in-section">
|
|
<h4 class="method-subtitle">Declared In</h4>
|
|
<p><code class="declared-in-ref">ASLayout.h</code></p>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</main>
|
|
|
|
<footer>
|
|
<div class="footer-copyright">
|
|
|
|
<p class="copyright">Copyright © 2016 AsyncDisplayKit. All rights reserved. Updated: 2016-11-05</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> |