mirror of
https://github.com/Instagram/IGListKit
synced 2026-04-21 13:37:19 +00:00
Summary: ## Changes in this pull request Updates the IGListKit docs to the latest API spec in v5.2.0 ### Checklist - [x] All tests pass. Demo project builds and runs. - [x] I added tests, an experiment, or detailed why my change isn't tested. - [x] I added an entry to the `CHANGELOG.md` for any breaking changes, enhancements, or bug fixes. - [x] I have reviewed the [contributing guide](https://github.com/Instagram/IGListKit/blob/main/.github/CONTRIBUTING.md) Pull Request resolved: https://github.com/instagram/IGListKit/pull/1656 Reviewed By: jurmarcus Differential Revision: D93350284 Pulled By: TimOliver fbshipit-source-id: fa4276caae7309f3ef0fd78f5a0c4bcc05d9cb9f
451 lines
23 KiB
HTML
451 lines
23 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<title>IGListDiffable Protocol Reference</title>
|
|
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
|
|
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
|
|
<meta charset='utf-8'>
|
|
<script src="../js/jquery.min.js" defer></script>
|
|
<script src="../js/jazzy.js" defer></script>
|
|
|
|
<script src="../js/lunr.min.js" defer></script>
|
|
<script src="../js/typeahead.jquery.js" defer></script>
|
|
<script src="../js/jazzy.search.js" defer></script>
|
|
</head>
|
|
<body>
|
|
<a name="//apple_ref/objc/Protocol/IGListDiffable" class="dashAnchor"></a>
|
|
<a title="IGListDiffable Protocol Reference"></a>
|
|
<header>
|
|
<div class="content-wrapper">
|
|
<p><a href="../index.html">IGListKit 5.2.0 Docs</a> (96% documented)</p>
|
|
<p class="header-right"><a href="https://github.com/Instagram/IGListKit"><img src="../img/gh.png" alt="GitHub"/>View on GitHub</a></p>
|
|
<div class="header-right">
|
|
<form role="search" action="../search.json">
|
|
<input type="text" placeholder="Search documentation" data-typeahead>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</header>
|
|
<div class="content-wrapper">
|
|
<p id="breadcrumbs">
|
|
<a href="../index.html">IGListKit</a>
|
|
<img id="carat" src="../img/carat.png" alt=""/>
|
|
<a href="../Protocols.html">Protocols</a>
|
|
<img id="carat" src="../img/carat.png" alt=""/>
|
|
IGListDiffable Protocol Reference
|
|
</p>
|
|
</div>
|
|
<div class="content-wrapper">
|
|
<nav class="sidebar">
|
|
<ul class="nav-groups">
|
|
<li class="nav-group-name">
|
|
<a href="../Guides.html">Guides</a>
|
|
<ul class="nav-group-tasks">
|
|
<li class="nav-group-task">
|
|
<a href="../best-practices-and-faq.html">Best Practices and FAQ</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="../generating-your-models-using-remodel.html">Generating your models using remodel</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="../getting-started.html">Getting Started</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="../iglistdiffable-and-equality.html">IGListDiffable and Equality</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="../installation.html">Installation</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="../migration.html">Migration</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="../modeling-and-binding.html">Modeling and Binding</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="../vision.html">VISION</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="../working-with-core-data.html">Working with Core Data</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="../working-with-uicollectionview.html">Working with UICollectionView</a>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
<li class="nav-group-name">
|
|
<a href="../Categories.html">Categories</a>
|
|
<ul class="nav-group-tasks">
|
|
<li class="nav-group-task">
|
|
<a href="../Categories/UIViewController%28IGListAdapter%29.html">UIViewController(IGListAdapter)</a>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
<li class="nav-group-name">
|
|
<a href="../Classes.html">Classes</a>
|
|
<ul class="nav-group-tasks">
|
|
<li class="nav-group-task">
|
|
<a href="../Classes/IGListAdapter.html">IGListAdapter</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="../Classes/IGListAdapterDelegateAnnouncer.html">IGListAdapterDelegateAnnouncer</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="../Classes/IGListAdapterUpdater.html">IGListAdapterUpdater</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="../Classes/IGListBatchUpdateData.html">IGListBatchUpdateData</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="../Classes/IGListBindingSectionController.html">IGListBindingSectionController</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="../Classes/IGListBindingSingleSectionController.html">IGListBindingSingleSectionController</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="../Classes/IGListCollectionView.html">IGListCollectionView</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="../Classes/IGListCollectionViewLayout.html">IGListCollectionViewLayout</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="../Classes/IGListCollectionViewLayoutInvalidationContext.html">IGListCollectionViewLayoutInvalidationContext</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="../Classes/IGListGenericSectionController.html">IGListGenericSectionController</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="../Classes/IGListIndexPathResult.html">IGListIndexPathResult</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="../Classes/IGListIndexSetResult.html">IGListIndexSetResult</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="../Classes/IGListMoveIndex.html">IGListMoveIndex</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="../Classes/IGListMoveIndexPath.html">IGListMoveIndexPath</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="../Classes.html#/c:objc(cs)IGListReloadDataUpdater">IGListReloadDataUpdater</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="../Classes/IGListSectionController.html">IGListSectionController</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="../Classes/IGListSingleSectionController.html">IGListSingleSectionController</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="../Classes/IGListTransitionData.html">IGListTransitionData</a>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
<li class="nav-group-name">
|
|
<a href="../Constants.html">Constants</a>
|
|
<ul class="nav-group-tasks">
|
|
<li class="nav-group-task">
|
|
<a href="../Constants.html#/c:@IGListKitVersionNumber">IGListKitVersionNumber</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="../Constants.html#/c:@IGListKitVersionString">IGListKitVersionString</a>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
<li class="nav-group-name">
|
|
<a href="../Enums.html">Enumerations</a>
|
|
<ul class="nav-group-tasks">
|
|
<li class="nav-group-task">
|
|
<a href="../Enums/IGListAdapterUpdateType.html">IGListAdapterUpdateType</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="../Enums/IGListDiffOption.html">IGListDiffOption</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="../Enums/IGListExperiment.html">IGListExperiment</a>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
<li class="nav-group-name">
|
|
<a href="../Protocols.html">Protocols</a>
|
|
<ul class="nav-group-tasks">
|
|
<li class="nav-group-task">
|
|
<a href="../Protocols/IGListAdapterDataSource.html">IGListAdapterDataSource</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="../Protocols/IGListAdapterDelegate.html">IGListAdapterDelegate</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="../Protocols/IGListAdapterMoveDelegate.html">IGListAdapterMoveDelegate</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="../Protocols/IGListAdapterPerformanceDelegate.html">IGListAdapterPerformanceDelegate</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="../Protocols/IGListAdapterUpdateListener.html">IGListAdapterUpdateListener</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="../Protocols/IGListAdapterUpdaterDelegate.html">IGListAdapterUpdaterDelegate</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="../Protocols/IGListBatchContext.html">IGListBatchContext</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="../Protocols/IGListBindable.html">IGListBindable</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="../Protocols/IGListBindingSectionControllerDataSource.html">IGListBindingSectionControllerDataSource</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="../Protocols/IGListBindingSectionControllerSelectionDelegate.html">IGListBindingSectionControllerSelectionDelegate</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="../Protocols/IGListCollectionContext.html">IGListCollectionContext</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="../Protocols/IGListCollectionViewDelegateLayout.html">IGListCollectionViewDelegateLayout</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="../Protocols/IGListCollectionViewLayoutCompatible.html">IGListCollectionViewLayoutCompatible</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="../Protocols/IGListDiffable.html">IGListDiffable</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="../Protocols/IGListDisplayDelegate.html">IGListDisplayDelegate</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="../Protocols/IGListScrollDelegate.html">IGListScrollDelegate</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="../Protocols/IGListSingleSectionControllerDelegate.html">IGListSingleSectionControllerDelegate</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="../Protocols/IGListSupplementaryViewSource.html">IGListSupplementaryViewSource</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="../Protocols/IGListTransitionDelegate.html">IGListTransitionDelegate</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="../Protocols/IGListUpdatingDelegate.html">IGListUpdatingDelegate</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="../Protocols/IGListWorkingRangeDelegate.html">IGListWorkingRangeDelegate</a>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
<li class="nav-group-name">
|
|
<a href="../Type%20Definitions.html">Type Definitions</a>
|
|
<ul class="nav-group-tasks">
|
|
<li class="nav-group-task">
|
|
<a href="../Type%20Definitions/IGListAdaptiveCoalescingExperimentConfig.html">IGListAdaptiveCoalescingExperimentConfig</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="../Type%20Definitions/IGListAdaptiveDiffingExperimentConfig.html">IGListAdaptiveDiffingExperimentConfig</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="../Type%20Definitions/IGListCollectionScrollingTraits.html">IGListCollectionScrollingTraits</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="../Type%20Definitions.html#/c:IGListUpdatingDelegate.h@T@IGListCollectionViewBlock">IGListCollectionViewBlock</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="../Type%20Definitions.html#/c:IGListUpdatingDelegate.h@T@IGListDataSourceChangeBlock">IGListDataSourceChangeBlock</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="../Type%20Definitions.html#/c:IGListUpdatingDelegate.h@T@IGListItemUpdateBlock">IGListItemUpdateBlock</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="../Type%20Definitions.html#/c:IGListUpdatingDelegate.h@T@IGListObjectTransitionBlock">IGListObjectTransitionBlock</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="../Type%20Definitions.html#/c:IGListUpdatingDelegate.h@T@IGListReloadUpdateBlock">IGListReloadUpdateBlock</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="../Type%20Definitions.html#/c:IGListSingleSectionController.h@T@IGListSingleSectionCellConfigureBlock">IGListSingleSectionCellConfigureBlock</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="../Type%20Definitions.html#/c:IGListSingleSectionController.h@T@IGListSingleSectionCellSizeBlock">IGListSingleSectionCellSizeBlock</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="../Type%20Definitions.html#/c:IGListUpdatingDelegate.h@T@IGListToObjectBlock">IGListToObjectBlock</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="../Type%20Definitions.html#/c:IGListUpdatingDelegate.h@T@IGListTransitionDataApplyBlock">IGListTransitionDataApplyBlock</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="../Type%20Definitions.html#/c:IGListUpdatingDelegate.h@T@IGListTransitionDataBlock">IGListTransitionDataBlock</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="../Type%20Definitions.html#/c:IGListAdapter.h@T@IGListUpdaterCompletion">IGListUpdaterCompletion</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="../Type%20Definitions.html#/c:IGListUpdatingDelegate.h@T@IGListUpdatingCompletion">IGListUpdatingCompletion</a>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
<li class="nav-group-name">
|
|
<a href="../Functions.html">Functions</a>
|
|
<ul class="nav-group-tasks">
|
|
<li class="nav-group-task">
|
|
<a href="../Functions.html#/c:@F@IGListDiff">IGListDiff</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="../Functions.html#/c:@F@IGListDiffPaths">IGListDiffPaths</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="../Functions.html#/c:IGListExperiments.h@F@IGListExperimentEnabled">IGListExperimentEnabled</a>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
<li class="nav-group-name">
|
|
<a href="../Structs.html">Structures</a>
|
|
<ul class="nav-group-tasks">
|
|
<li class="nav-group-task">
|
|
<a href="../Structs/IGListAdaptiveCoalescingExperimentConfig.html">IGListAdaptiveCoalescingExperimentConfig</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="../Structs/IGListAdaptiveDiffingExperimentConfig.html">IGListAdaptiveDiffingExperimentConfig</a>
|
|
</li>
|
|
<li class="nav-group-task">
|
|
<a href="../Structs/IGListCollectionScrollingTraits.html">IGListCollectionScrollingTraits</a>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</nav>
|
|
<article class="main-content">
|
|
<section>
|
|
<section class="section">
|
|
<h1>IGListDiffable</h1>
|
|
<div class="declaration">
|
|
<div class="language">
|
|
<p class="aside-title">Objective-C</p>
|
|
<pre class="highlight objective_c"><code><span class="k">@protocol</span> <span class="nc">IGListDiffable</span></code></pre>
|
|
|
|
</div>
|
|
<div class="language">
|
|
<p class="aside-title">Swift</p>
|
|
<pre class="highlight swift"><code><span class="kd">protocol</span> <span class="kt">ListDiffable</span></code></pre>
|
|
|
|
</div>
|
|
</div>
|
|
<p>The <code>IGListDiffable</code> protocol provides methods needed to compare the identity and equality of two objects.</p>
|
|
|
|
</section>
|
|
<section class="section task-group-section">
|
|
<div class="task-group">
|
|
<ul>
|
|
<li class="item">
|
|
<div>
|
|
<code>
|
|
<a name="/c:objc(pl)IGListDiffable(im)diffIdentifier"></a>
|
|
<a name="//apple_ref/objc/Method/-diffIdentifier" class="dashAnchor"></a>
|
|
<a class="token" href="#/c:objc(pl)IGListDiffable(im)diffIdentifier">-diffIdentifier</a>
|
|
</code>
|
|
</div>
|
|
<div class="height-container">
|
|
<div class="pointer-container"></div>
|
|
<section class="section">
|
|
<div class="pointer"></div>
|
|
<div class="abstract">
|
|
<p>Returns a key that uniquely identifies the object.</p>
|
|
<div class="aside aside-note">
|
|
<p class="aside-title">Note</p>
|
|
<p>Two objects may share the same identifier, but are not equal. A common pattern is to use the <code>NSObject</code>
|
|
category for automatic conformance. However this means that objects will be identified on their
|
|
pointer value so finding updates becomes impossible.</p>
|
|
|
|
</div><div class="aside aside-warning">
|
|
<p class="aside-title">Warning</p>
|
|
<p>This value should never be mutated.</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<div class="declaration">
|
|
<h4>Declaration</h4>
|
|
<div class="language">
|
|
<p class="aside-title">Objective-C</p>
|
|
<pre class="highlight objective_c"><code><span class="k">-</span> <span class="p">(</span><span class="n">nonnull</span> <span class="n">id</span><span class="o"><</span><span class="n">NSObject</span><span class="o">></span><span class="p">)</span><span class="n">diffIdentifier</span><span class="p">;</span></code></pre>
|
|
|
|
</div>
|
|
<div class="language">
|
|
<p class="aside-title">Swift</p>
|
|
<pre class="highlight swift"><code><span class="kd">func</span> <span class="nf">diffIdentifier</span><span class="p">()</span> <span class="o">-></span> <span class="n">any</span> <span class="kt">NSObjectProtocol</span></code></pre>
|
|
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<h4>Return Value</h4>
|
|
<p>A key that can be used to uniquely identify the object.</p>
|
|
</div>
|
|
</section>
|
|
</div>
|
|
</li>
|
|
<li class="item">
|
|
<div>
|
|
<code>
|
|
<a name="/c:objc(pl)IGListDiffable(im)isEqualToDiffableObject:"></a>
|
|
<a name="//apple_ref/objc/Method/-isEqualToDiffableObject:" class="dashAnchor"></a>
|
|
<a class="token" href="#/c:objc(pl)IGListDiffable(im)isEqualToDiffableObject:">-isEqualToDiffableObject:<wbr></a>
|
|
</code>
|
|
</div>
|
|
<div class="height-container">
|
|
<div class="pointer-container"></div>
|
|
<section class="section">
|
|
<div class="pointer"></div>
|
|
<div class="abstract">
|
|
<p>Returns whether the receiver and a given object are equal.</p>
|
|
|
|
</div>
|
|
<div class="declaration">
|
|
<h4>Declaration</h4>
|
|
<div class="language">
|
|
<p class="aside-title">Objective-C</p>
|
|
<pre class="highlight objective_c"><code><span class="k">-</span> <span class="p">(</span><span class="n">BOOL</span><span class="p">)</span><span class="nf">isEqualToDiffableObject</span><span class="p">:(</span><span class="n">nullable</span> <span class="n">id</span><span class="o"><</span><span class="n">IGListDiffable</span><span class="o">></span><span class="p">)</span><span class="nv">object</span><span class="p">;</span></code></pre>
|
|
|
|
</div>
|
|
<div class="language">
|
|
<p class="aside-title">Swift</p>
|
|
<pre class="highlight swift"><code><span class="kd">func</span> <span class="nf">isEqual</span><span class="p">(</span><span class="n">toDiffableObject</span> <span class="nv">object</span><span class="p">:</span> <span class="p">(</span><span class="n">any</span> <span class="kt">ListDiffable</span><span class="p">)?)</span> <span class="o">-></span> <span class="kt">Bool</span></code></pre>
|
|
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<h4>Parameters</h4>
|
|
<table class="graybox">
|
|
<tbody>
|
|
<tr>
|
|
<td>
|
|
<code>
|
|
<em>object</em>
|
|
</code>
|
|
</td>
|
|
<td>
|
|
<div>
|
|
<p>The object to be compared to the receiver.</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div>
|
|
<h4>Return Value</h4>
|
|
<p><code>YES</code> if the receiver and object are equal, otherwise <code>NO</code>.</p>
|
|
</div>
|
|
</section>
|
|
</div>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</section>
|
|
</section>
|
|
<section id="footer">
|
|
<p>© 2026 <a class="link" href="https://twitter.com/MetaOpenSource" target="_blank" rel="external noopener">Instagram</a>. All rights reserved. (Last updated: 2026-02-15)</p>
|
|
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external noopener">jazzy ♪♫ v0.15.4</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external noopener">Realm</a> project.</p>
|
|
</section>
|
|
</article>
|
|
</div>
|
|
</body>
|
|
</html>
|