24 Commits

Author SHA1 Message Date
Ryo Aoyama a457cf6345 Merge pull request #38 from ra1028/v0.5.0
Bump version to 0.5.0
2021-06-09 00:25:33 +09:00
Ryo Aoyama 1e7bc4ef06 Update docs 2021-06-09 00:18:07 +09:00
Ryo Aoyama 11a688de71 Update .version 2021-06-09 00:15:30 +09:00
Ryo Aoyama f1c2b9065f Merge pull request #29 from jdanthinne/master
Add missing sectionIndexTitles method for tableviews
2021-06-09 00:11:09 +09:00
Ryo Aoyama 203c0f1582 Merge pull request #27 from sidepelican/patch-1
Fix compile error of sample mac application
2021-06-09 00:09:06 +09:00
Ryo Aoyama bb5ce92196 Merge pull request #30 from fossil12/patch-1
Fix typo
2021-06-09 00:08:36 +09:00
Ryo Aoyama 8094e6a0fc Merge pull request #35 from ra1028/dependabot/bundler/redcarpet-3.5.1
Bump redcarpet from 3.5.0 to 3.5.1
2021-06-09 00:08:17 +09:00
Ryo Aoyama 349029fbc3 Merge pull request #25 from ra1028/dependabot/bundler/json-2.3.1
Bump json from 2.2.0 to 2.3.1
2021-06-09 00:08:05 +09:00
Ryo Aoyama 496ee1c177 Merge pull request #37 from vincentisambart/arm64-mac
Support for ARM64 Macs
2021-06-09 00:03:59 +09:00
Vincent Isambart 444ad0cfaa Support for ARM64 Macs 2021-05-20 15:23:42 +09:00
dependabot[bot] fe2027486b Bump redcarpet from 3.5.0 to 3.5.1
Bumps [redcarpet](https://github.com/vmg/redcarpet) from 3.5.0 to 3.5.1.
- [Release notes](https://github.com/vmg/redcarpet/releases)
- [Changelog](https://github.com/vmg/redcarpet/blob/master/CHANGELOG.md)
- [Commits](https://github.com/vmg/redcarpet/compare/v3.5.0...v3.5.1)

Signed-off-by: dependabot[bot] <support@github.com>
2021-01-11 19:45:47 +00:00
David Keller f9cc696c83 Fix typo 2020-09-07 20:15:52 +02:00
Jérôme Danthinne 7e96a251d7 Add missing sectionIndexTitles method for tableviews 2020-08-18 14:06:55 +02:00
Iceman 8c9f02785d Fix compile error of sample mac application 2020-08-02 22:48:06 +09:00
dependabot[bot] bbe3a16e1a Bump json from 2.2.0 to 2.3.1
Bumps [json](https://github.com/flori/json) from 2.2.0 to 2.3.1.
- [Release notes](https://github.com/flori/json/releases)
- [Changelog](https://github.com/flori/json/blob/master/CHANGES.md)
- [Commits](https://github.com/flori/json/compare/v2.2.0...v2.3.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-07-28 04:58:11 +00:00
Ryo Aoyama 581b4f8d16 Merge pull request #23 from ra1028/v0.4.0
Bump version to 0.4.0
2020-04-12 09:08:41 +09:00
Ryo Aoyama 7917b9ecac Bump version to 0.4.0 2020-04-12 08:44:25 +09:00
Ryo Aoyama ad96fe29f9 Merge pull request #22 from bobek-balinek/feature/missing-data-source-methods
Add default implementation for other UITableViewDelegate/UICollectionViewDelegate methods
2020-04-12 08:26:52 +09:00
Bobby Bobak d0fa27e772 Merge branch 'master' into feature/missing-data-source-methods 2020-04-07 15:13:22 +01:00
Bobby Bobak 46460779e6 Add tests for newly added methods and update the implementation of the CollectionViewDiffableDataSource with canMove/moveItemAt methods 2020-04-07 10:11:42 +01:00
Ryo Aoyama d3e5bb4f2d Merge pull request #20 from bitsfabrik/master
Compiler Error Swift.Collection required
2020-04-01 00:14:04 +09:00
Bobby Bobak 7152ec831f Possible fix for the build error 2020-03-26 19:50:29 +00:00
BiNo 74f554c2b9 add Swift.Collection 2020-03-25 15:37:35 +01:00
Bobby Bobak e132707c44 Add all of the remaining UITableViewDataSource methods to the TableViewDiffableDataSource 2020-01-15 14:27:17 +00:00
24 changed files with 716 additions and 38 deletions
+1
View File
@@ -0,0 +1 @@
0.5.0
+1 -1
View File
@@ -1 +1 @@
github "ra1028/DifferenceKit" ~> 1.1
github "ra1028/DifferenceKit" ~> 1.2
+1 -1
View File
@@ -1 +1 @@
github "ra1028/DifferenceKit" "1.1.4"
github "ra1028/DifferenceKit" "1.2.0"
+1 -1
View File
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = 'DiffableDataSources'
spec.version = '0.3.0'
spec.version = `cat .version`
spec.author = { 'ra1028' => 'r.fe51028.r@gmail.com' }
spec.homepage = 'https://github.com/ra1028/DiffableDataSources'
spec.documentation_url = 'https://ra1028.github.io/DiffableDataSources'
@@ -49,7 +49,7 @@ final class MountainsViewController: NSViewController {
.filter { $0.contains(filter) }
.sorted { $0.name < $1.name }
let snapshot = DiffableDataSourceSnapshot<Section, Mountain>()
var snapshot = DiffableDataSourceSnapshot<Section, Mountain>()
snapshot.appendSections([.main])
snapshot.appendItems(mountains)
dataSource.apply(snapshot)
+2 -2
View File
@@ -66,7 +66,7 @@ GEM
sassc (~> 2.1)
sqlite3 (~> 1.3)
xcinvoke (~> 0.3.0)
json (2.2.0)
json (2.3.1)
liferaft (0.0.6)
minitest (5.13.0)
molinillo (0.6.6)
@@ -75,7 +75,7 @@ GEM
nap (1.1.0)
netrc (0.11.0)
open4 (1.3.4)
redcarpet (3.5.0)
redcarpet (3.5.1)
rouge (3.13.0)
ruby-macho (1.4.0)
sassc (2.2.1)
+2 -2
View File
@@ -6,8 +6,8 @@
"repositoryURL": "https://github.com/ra1028/DifferenceKit.git",
"state": {
"branch": null,
"revision": "4eb31f8e85e4cb13732f9664d6e01e507cd592a0",
"version": "1.1.3"
"revision": "62745d7780deef4a023a792a1f8f763ec7bf9705",
"version": "1.2.0"
}
}
]
+1 -1
View File
@@ -11,7 +11,7 @@ let package = Package(
.library(name: "DiffableDataSources", targets: ["DiffableDataSources"])
],
dependencies: [
.package(url: "https://github.com/ra1028/DifferenceKit.git", .upToNextMinor(from: "1.1.0"))
.package(url: "https://github.com/ra1028/DifferenceKit.git", .upToNextMinor(from: "1.2.0"))
],
targets: [
.target(
+1 -1
View File
@@ -91,7 +91,7 @@ $ open DiffableDataSources.xcworkspace
First, define the type representing section.
It should conforms to `Hashable` for identifies from the all sections.
Type of enum can used conveniently befause it conforms `Hashable` by default.
Type of enum can used conveniently because it conforms `Hashable` by default.
```swift
enum Section {
+1 -1
View File
@@ -35,7 +35,7 @@ struct SnapshotStructure<SectionID: Hashable, ItemID: Hashable> {
self.init(id: id, items: [], isReloaded: false)
}
init<C: Collection>(source: Section, elements: C) where C.Element == Item {
init<C: Swift.Collection>(source: Section, elements: C) where C.Element == Item {
self.init(id: source.differenceIdentifier, items: Array(elements), isReloaded: source.isReloaded)
}
@@ -132,6 +132,29 @@ open class CollectionViewDiffableDataSource<SectionIdentifierType: Hashable, Ite
return view
}
/// Returns whether it is possible to edit a row at given index path.
///
/// - Parameters:
/// - collectionView: A collection view instance managed by `self`.
/// - section: An index of section.
///
/// - Returns: A boolean for row at specified index path.
open func collectionView(_ collectionView: UICollectionView, canMoveItemAt indexPath: IndexPath) -> Bool {
return false
}
/// Moves a row at given index path.
///
/// - Parameters:
/// - collectionView: A collection view instance managed by `self`.
/// - sourceIndexPath: An index path for given cell position.
/// - destinationIndexPath: An index path for target cell position.
///
/// - Returns: Void.
public func collectionView(_ collectionView: UICollectionView, moveItemAt sourceIndexPath: IndexPath, to destinationIndexPath: IndexPath) {
// Empty implementation.
}
}
#endif
@@ -135,6 +135,74 @@ open class TableViewDiffableDataSource<SectionIdentifierType: Hashable, ItemIden
return cell
}
/// Returns whether it is possible to edit a row at given index path.
///
/// - Parameters:
/// - tableView: A table view instance managed by `self`.
/// - section: An index of section.
///
/// - Returns: A boolean for row at specified index path.
open func tableView(_ tableView: UITableView, canEditRowAt: IndexPath) -> Bool {
return false
}
/// Returns whether it is possible to move a row at given index path.
///
/// - Parameters:
/// - tableView: A table view instance managed by `self`.
/// - section: An index of section.
///
/// - Returns: A boolean for row at specified index path.
open func tableView(_ tableView: UITableView, canMoveRowAt _: IndexPath) -> Bool {
return false
}
/// Performs the edit action for a row at given index path.
///
/// - Parameters:
/// - tableView: A table view instance managed by `self`.
/// - editingStyle: An action for given edit action.
/// - indexPath: An index path for cell.
///
/// - Returns: Void.
open func tableView(_ tableView: UITableView, commit _: UITableViewCell.EditingStyle, forRowAt _: IndexPath) {
// Empty implementation.
}
/// Moves a row at given index path.
///
/// - Parameters:
/// - tableView: A table view instance managed by `self`.
/// - source: An index path for given cell position.
/// - target: An index path for target cell position.
///
/// - Returns: Void.
open func tableView(_ tableView: UITableView, moveRowAt _: IndexPath, to _: IndexPath) {
// Empty implementation.
}
/// Return list of section titles to display in section index view (e.g. "ABCD...Z#").
///
/// - Parameters:
/// - tableView: A table view instance managed by `self`.
///
/// - Returns: The list of section titles to display.
open func sectionIndexTitles(for tableView: UITableView) -> [String]? {
return nil
}
/// Tell table which section corresponds to section title/index (e.g. "B",1)).
///
/// - Parameters:
/// - tableView: A table view instance managed by `self`.
/// - title: The title as displayed in the section index of tableView.
/// - section: An index number identifying a section title in the array returned by sectionIndexTitles(for tableView:).
///
/// - Returns: The list of section titles to display.
open func tableView(_ tableView: UITableView, sectionForSectionIndexTitle _: String, at section: Int) -> Int {
return section
}
}
#endif
@@ -167,6 +167,24 @@ final class CollectionViewDiffableDataSourceTests: XCTestCase {
cell
)
}
func testCanMoveRowAt() {
let collectionView = MockCollectionView()
let cell = UICollectionViewCell()
let dataSource = CollectionViewDiffableDataSource<Int, Int>(collectionView: collectionView) { _, _, _ in
cell
}
var snapshot = DiffableDataSourceSnapshot<Int, Int>()
snapshot.appendSections([0, 1, 2])
snapshot.appendItems([0, 1, 2], toSection: 0)
dataSource.apply(snapshot)
XCTAssertEqual(
dataSource.collectionView(collectionView, canMoveItemAt: IndexPath(item: 1, section: 0)),
false
)
}
}
final class MockCollectionView: UICollectionView {
@@ -167,6 +167,42 @@ final class TableViewDiffableDataSourceTests: XCTestCase {
cell
)
}
func testCanEditRowAt() {
let tableView = MockTableView()
let cell = UITableViewCell()
let dataSource = TableViewDiffableDataSource<Int, Int>(tableView: tableView) { _, _, _ in
cell
}
var snapshot = DiffableDataSourceSnapshot<Int, Int>()
snapshot.appendSections([0, 1, 2])
snapshot.appendItems([0, 1, 2], toSection: 0)
dataSource.apply(snapshot)
XCTAssertEqual(
dataSource.tableView(tableView, canEditRowAt: IndexPath(item: 1, section: 0)),
false
)
}
func testCanMoveRowAt() {
let tableView = MockTableView()
let cell = UITableViewCell()
let dataSource = TableViewDiffableDataSource<Int, Int>(tableView: tableView) { _, _, _ in
cell
}
var snapshot = DiffableDataSourceSnapshot<Int, Int>()
snapshot.appendSections([0, 1, 2])
snapshot.appendItems([0, 1, 2], toSection: 0)
dataSource.apply(snapshot)
XCTAssertEqual(
dataSource.tableView(tableView, canMoveRowAt: IndexPath(item: 1, section: 0)),
false
)
}
}
final class MockTableView: UITableView {
+3 -3
View File
@@ -5,11 +5,11 @@ TVOS_DEPLOYMENT_TARGET = 9.0
SDKROOT =
SUPPORTED_PLATFORMS = macosx iphoneos iphonesimulator appletvos appletvsimulator
TARGETED_DEVICE_FAMILY = 1,2,3
VALID_ARCHS[sdk=macosx*] = i386 x86_64
VALID_ARCHS[sdk=macosx*] = arm64 i386 x86_64
VALID_ARCHS[sdk=iphoneos*] = arm64 armv7 armv7s
VALID_ARCHS[sdk=iphonesimulator*] = i386 x86_64
VALID_ARCHS[sdk=iphonesimulator*] = arm64 i386 x86_64
VALID_ARCHS[sdk=appletv*] = arm64
VALID_ARCHS[sdk=appletvsimulator*] = x86_64
VALID_ARCHS[sdk=appletvsimulator*] = arm64 x86_64
CODE_SIGN_IDENTITY =
CODE_SIGN_STYLE = Manual
@@ -23,7 +23,7 @@
<a class="header-link" href="../index.html">
DiffableDataSources Docs
</a>
(100% documented)
(98% documented)
</p>
<p class="header-col--secondary">
@@ -167,7 +167,7 @@ changes with automatic diffing.</p>
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">supplementaryViewProvider</span><span class="p">:</span> <span class="kt">CollectionViewDiffableDataSource</span><span class="o">&lt;</span><span class="kt">SectionIdentifierType</span><span class="p">,</span> <span class="kt">ItemIdentifierType</span><span class="o">&gt;.</span><span class="kt"><a href="../Classes/CollectionViewDiffableDataSource.html#/s:19DiffableDataSources014CollectionViewaB6SourceC013SupplementaryE8Providera">SupplementaryViewProvider</a></span><span class="p">?</span></code></pre>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">supplementaryViewProvider</span><span class="p">:</span> <span class="kt"><a href="../Classes/CollectionViewDiffableDataSource.html#/s:19DiffableDataSources014CollectionViewaB6SourceC013SupplementaryE8Providera">SupplementaryViewProvider</a></span><span class="p">?</span></code></pre>
</div>
</div>
@@ -683,6 +683,142 @@ changes with automatic diffing.</p>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:19DiffableDataSources014CollectionViewaB6SourceC010collectionE0_13canMoveItemAtSbSo012UICollectionE0C_10Foundation9IndexPathVtF"></a>
<a name="//apple_ref/swift/Method/collectionView(_:canMoveItemAt:)" class="dashAnchor"></a>
<a class="token" href="#/s:19DiffableDataSources014CollectionViewaB6SourceC010collectionE0_13canMoveItemAtSbSo012UICollectionE0C_10Foundation9IndexPathVtF">collectionView(_:canMoveItemAt:)</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 it is possible to edit a row at given index path.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">open</span> <span class="kd">func</span> <span class="nf">collectionView</span><span class="p">(</span><span class="n">_</span> <span class="nv">collectionView</span><span class="p">:</span> <span class="kt">UICollectionView</span><span class="p">,</span> <span class="n">canMoveItemAt</span> <span class="nv">indexPath</span><span class="p">:</span> <span class="kt">IndexPath</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Bool</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>collectionView</em>
</code>
</td>
<td>
<div>
<p>A collection view instance managed by <code>self</code>.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>section</em>
</code>
</td>
<td>
<div>
<p>An index of section.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>A boolean for row at specified index path.</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:19DiffableDataSources014CollectionViewaB6SourceC010collectionE0_10moveItemAt2toySo012UICollectionE0C_10Foundation9IndexPathVAKtF"></a>
<a name="//apple_ref/swift/Method/collectionView(_:moveItemAt:to:)" class="dashAnchor"></a>
<a class="token" href="#/s:19DiffableDataSources014CollectionViewaB6SourceC010collectionE0_10moveItemAt2toySo012UICollectionE0C_10Foundation9IndexPathVAKtF">collectionView(_:moveItemAt:to:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Moves a row at given index path.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">collectionView</span><span class="p">(</span><span class="n">_</span> <span class="nv">collectionView</span><span class="p">:</span> <span class="kt">UICollectionView</span><span class="p">,</span> <span class="n">moveItemAt</span> <span class="nv">sourceIndexPath</span><span class="p">:</span> <span class="kt">IndexPath</span><span class="p">,</span> <span class="n">to</span> <span class="nv">destinationIndexPath</span><span class="p">:</span> <span class="kt">IndexPath</span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>collectionView</em>
</code>
</td>
<td>
<div>
<p>A collection view instance managed by <code>self</code>.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>sourceIndexPath</em>
</code>
</td>
<td>
<div>
<p>An index path for given cell position.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>destinationIndexPath</em>
</code>
</td>
<td>
<div>
<p>An index path for target cell position.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>Void.</p>
</div>
</section>
</div>
</li>
</ul>
</div>
</div>
@@ -691,7 +827,7 @@ changes with automatic diffing.</p>
</article>
</div>
<section class="footer">
<p>&copy; 2019 <a class="link" href="https://github.com/ra1028" target="_blank" rel="external">Ryo Aoyama</a>. All rights reserved. (Last updated: 2019-12-10)</p>
<p>&copy; 2021 <a class="link" href="https://github.com/ra1028" target="_blank" rel="external">Ryo Aoyama</a>. All rights reserved. (Last updated: 2021-06-09)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.11.2</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</body>
+398 -2
View File
@@ -23,7 +23,7 @@
<a class="header-link" href="../index.html">
DiffableDataSources Docs
</a>
(100% documented)
(98% documented)
</p>
<p class="header-col--secondary">
@@ -706,6 +706,402 @@ changes with automatic diffing.</p>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:19DiffableDataSources09TableViewaB6SourceC05tableE0_12canEditRowAtSbSo07UITableE0C_10Foundation9IndexPathVtF"></a>
<a name="//apple_ref/swift/Method/tableView(_:canEditRowAt:)" class="dashAnchor"></a>
<a class="token" href="#/s:19DiffableDataSources09TableViewaB6SourceC05tableE0_12canEditRowAtSbSo07UITableE0C_10Foundation9IndexPathVtF">tableView(_:canEditRowAt:)</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 it is possible to edit a row at given index path.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">open</span> <span class="kd">func</span> <span class="nf">tableView</span><span class="p">(</span><span class="n">_</span> <span class="nv">tableView</span><span class="p">:</span> <span class="kt">UITableView</span><span class="p">,</span> <span class="nv">canEditRowAt</span><span class="p">:</span> <span class="kt">IndexPath</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Bool</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>tableView</em>
</code>
</td>
<td>
<div>
<p>A table view instance managed by <code>self</code>.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>section</em>
</code>
</td>
<td>
<div>
<p>An index of section.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>A boolean for row at specified index path.</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:19DiffableDataSources09TableViewaB6SourceC05tableE0_12canMoveRowAtSbSo07UITableE0C_10Foundation9IndexPathVtF"></a>
<a name="//apple_ref/swift/Method/tableView(_:canMoveRowAt:)" class="dashAnchor"></a>
<a class="token" href="#/s:19DiffableDataSources09TableViewaB6SourceC05tableE0_12canMoveRowAtSbSo07UITableE0C_10Foundation9IndexPathVtF">tableView(_:canMoveRowAt:)</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 it is possible to move a row at given index path.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">open</span> <span class="kd">func</span> <span class="nf">tableView</span><span class="p">(</span><span class="n">_</span> <span class="nv">tableView</span><span class="p">:</span> <span class="kt">UITableView</span><span class="p">,</span> <span class="n">canMoveRowAt</span> <span class="nv">_</span><span class="p">:</span> <span class="kt">IndexPath</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Bool</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>tableView</em>
</code>
</td>
<td>
<div>
<p>A table view instance managed by <code>self</code>.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>section</em>
</code>
</td>
<td>
<div>
<p>An index of section.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>A boolean for row at specified index path.</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:19DiffableDataSources09TableViewaB6SourceC05tableE0_6commit8forRowAtySo07UITableE0C_So0lE16CellEditingStyleV10Foundation9IndexPathVtF"></a>
<a name="//apple_ref/swift/Method/tableView(_:commit:forRowAt:)" class="dashAnchor"></a>
<a class="token" href="#/s:19DiffableDataSources09TableViewaB6SourceC05tableE0_6commit8forRowAtySo07UITableE0C_So0lE16CellEditingStyleV10Foundation9IndexPathVtF">tableView(_:commit:forRowAt:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Performs the edit action for a row at given index path.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">open</span> <span class="kd">func</span> <span class="nf">tableView</span><span class="p">(</span><span class="n">_</span> <span class="nv">tableView</span><span class="p">:</span> <span class="kt">UITableView</span><span class="p">,</span> <span class="n">commit</span> <span class="nv">_</span><span class="p">:</span> <span class="kt">UITableViewCell</span><span class="o">.</span><span class="kt">EditingStyle</span><span class="p">,</span> <span class="n">forRowAt</span> <span class="nv">_</span><span class="p">:</span> <span class="kt">IndexPath</span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>tableView</em>
</code>
</td>
<td>
<div>
<p>A table view instance managed by <code>self</code>.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>editingStyle</em>
</code>
</td>
<td>
<div>
<p>An action for given edit action.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>indexPath</em>
</code>
</td>
<td>
<div>
<p>An index path for cell.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>Void.</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:19DiffableDataSources09TableViewaB6SourceC05tableE0_9moveRowAt2toySo07UITableE0C_10Foundation9IndexPathVAKtF"></a>
<a name="//apple_ref/swift/Method/tableView(_:moveRowAt:to:)" class="dashAnchor"></a>
<a class="token" href="#/s:19DiffableDataSources09TableViewaB6SourceC05tableE0_9moveRowAt2toySo07UITableE0C_10Foundation9IndexPathVAKtF">tableView(_:moveRowAt:to:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Moves a row at given index path.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">open</span> <span class="kd">func</span> <span class="nf">tableView</span><span class="p">(</span><span class="n">_</span> <span class="nv">tableView</span><span class="p">:</span> <span class="kt">UITableView</span><span class="p">,</span> <span class="n">moveRowAt</span> <span class="nv">_</span><span class="p">:</span> <span class="kt">IndexPath</span><span class="p">,</span> <span class="n">to</span> <span class="nv">_</span><span class="p">:</span> <span class="kt">IndexPath</span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>tableView</em>
</code>
</td>
<td>
<div>
<p>A table view instance managed by <code>self</code>.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>source</em>
</code>
</td>
<td>
<div>
<p>An index path for given cell position.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>target</em>
</code>
</td>
<td>
<div>
<p>An index path for target cell position.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>Void.</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:19DiffableDataSources09TableViewaB6SourceC18sectionIndexTitles3forSaySSGSgSo07UITableE0C_tF"></a>
<a name="//apple_ref/swift/Method/sectionIndexTitles(for:)" class="dashAnchor"></a>
<a class="token" href="#/s:19DiffableDataSources09TableViewaB6SourceC18sectionIndexTitles3forSaySSGSgSo07UITableE0C_tF">sectionIndexTitles(for:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Return list of section titles to display in section index view (e.g. <q>ABCD&hellip;Z#</q>).</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">open</span> <span class="kd">func</span> <span class="nf">sectionIndexTitles</span><span class="p">(</span><span class="k">for</span> <span class="nv">tableView</span><span class="p">:</span> <span class="kt">UITableView</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="p">[</span><span class="kt">String</span><span class="p">]?</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>tableView</em>
</code>
</td>
<td>
<div>
<p>A table view instance managed by <code>self</code>.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>The list of section titles to display.</p>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:19DiffableDataSources09TableViewaB6SourceC05tableE0_27sectionForSectionIndexTitle2atSiSo07UITableE0C_SSSitF"></a>
<a name="//apple_ref/swift/Method/tableView(_:sectionForSectionIndexTitle:at:)" class="dashAnchor"></a>
<a class="token" href="#/s:19DiffableDataSources09TableViewaB6SourceC05tableE0_27sectionForSectionIndexTitle2atSiSo07UITableE0C_SSSitF">tableView(_:sectionForSectionIndexTitle:at:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Tell table which section corresponds to section title/index (e.g. <q>B</q>,1)).</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">open</span> <span class="kd">func</span> <span class="nf">tableView</span><span class="p">(</span><span class="n">_</span> <span class="nv">tableView</span><span class="p">:</span> <span class="kt">UITableView</span><span class="p">,</span> <span class="n">sectionForSectionIndexTitle</span> <span class="nv">_</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span> <span class="n">at</span> <span class="nv">section</span><span class="p">:</span> <span class="kt">Int</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Int</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>tableView</em>
</code>
</td>
<td>
<div>
<p>A table view instance managed by <code>self</code>.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>title</em>
</code>
</td>
<td>
<div>
<p>The title as displayed in the section index of tableView.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>section</em>
</code>
</td>
<td>
<div>
<p>An index number identifying a section title in the array returned by sectionIndexTitles(for tableView:).</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<h4>Return Value</h4>
<p>The list of section titles to display.</p>
</div>
</section>
</div>
</li>
</ul>
</div>
</div>
@@ -714,7 +1110,7 @@ changes with automatic diffing.</p>
</article>
</div>
<section class="footer">
<p>&copy; 2019 <a class="link" href="https://github.com/ra1028" target="_blank" rel="external">Ryo Aoyama</a>. All rights reserved. (Last updated: 2019-12-10)</p>
<p>&copy; 2021 <a class="link" href="https://github.com/ra1028" target="_blank" rel="external">Ryo Aoyama</a>. All rights reserved. (Last updated: 2021-06-09)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.11.2</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</body>
+2 -2
View File
@@ -23,7 +23,7 @@
<a class="header-link" href="index.html">
DiffableDataSources Docs
</a>
(100% documented)
(98% documented)
</p>
<p class="header-col--secondary">
@@ -156,7 +156,7 @@ changes with automatic diffing.</p>
</article>
</div>
<section class="footer">
<p>&copy; 2019 <a class="link" href="https://github.com/ra1028" target="_blank" rel="external">Ryo Aoyama</a>. All rights reserved. (Last updated: 2019-12-10)</p>
<p>&copy; 2021 <a class="link" href="https://github.com/ra1028" target="_blank" rel="external">Ryo Aoyama</a>. All rights reserved. (Last updated: 2021-06-09)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.11.2</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</body>
+2 -2
View File
@@ -23,7 +23,7 @@
<a class="header-link" href="index.html">
DiffableDataSources Docs
</a>
(100% documented)
(98% documented)
</p>
<p class="header-col--secondary">
@@ -121,7 +121,7 @@ Represents the mutable state of diffable data source of UI.</p>
</article>
</div>
<section class="footer">
<p>&copy; 2019 <a class="link" href="https://github.com/ra1028" target="_blank" rel="external">Ryo Aoyama</a>. All rights reserved. (Last updated: 2019-12-10)</p>
<p>&copy; 2021 <a class="link" href="https://github.com/ra1028" target="_blank" rel="external">Ryo Aoyama</a>. All rights reserved. (Last updated: 2021-06-09)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.11.2</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</body>
+2 -2
View File
@@ -23,7 +23,7 @@
<a class="header-link" href="../index.html">
DiffableDataSources Docs
</a>
(100% documented)
(98% documented)
</p>
<p class="header-col--secondary">
@@ -1264,7 +1264,7 @@ Represents the mutable state of diffable data source of UI.</p>
</article>
</div>
<section class="footer">
<p>&copy; 2019 <a class="link" href="https://github.com/ra1028" target="_blank" rel="external">Ryo Aoyama</a>. All rights reserved. (Last updated: 2019-12-10)</p>
<p>&copy; 2021 <a class="link" href="https://github.com/ra1028" target="_blank" rel="external">Ryo Aoyama</a>. All rights reserved. (Last updated: 2021-06-09)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.11.2</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</body>
+8 -8
View File
@@ -1,15 +1,15 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="136" height="20">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="128" height="20">
<linearGradient id="b" x2="0" y2="100%">
<stop offset="0" stop-color="#bbb" stop-opacity=".1"/>
<stop offset="1" stop-opacity=".1"/>
</linearGradient>
<clipPath id="a">
<rect width="136" height="20" rx="3" fill="#fff"/>
<rect width="128" height="20" rx="3" fill="#fff"/>
</clipPath>
<g clip-path="url(#a)">
<path fill="#555" d="M0 0h93v20H0z"/>
<path fill="#4c1" d="M93 0h43v20H93z"/>
<path fill="url(#b)" d="M0 0h136v20H0z"/>
<path fill="#4c1" d="M93 0h35v20H93z"/>
<path fill="url(#b)" d="M0 0h128v20H0z"/>
</g>
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="110">
<text x="475" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="830">
@@ -18,11 +18,11 @@
<text x="475" y="140" transform="scale(.1)" textLength="830">
documentation
</text>
<text x="1135" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="330">
100%
<text x="1095" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="250">
98%
</text>
<text x="1135" y="140" transform="scale(.1)" textLength="330">
100%
<text x="1095" y="140" transform="scale(.1)" textLength="250">
98%
</text>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

+3 -3
View File
@@ -22,7 +22,7 @@
<a class="header-link" href="index.html">
DiffableDataSources Docs
</a>
(100% documented)
(98% documented)
</p>
<p class="header-col--secondary">
@@ -176,7 +176,7 @@ Correspondence table is below. </p>
<p>First, define the type representing section.<br>
It should conforms to <code>Hashable</code> for identifies from the all sections.<br>
Type of enum can used conveniently befause it conforms <code>Hashable</code> by default. </p>
Type of enum can used conveniently because it conforms <code>Hashable</code> by default. </p>
<pre class="highlight swift"><code><span class="kd">enum</span> <span class="kt">Section</span> <span class="p">{</span>
<span class="k">case</span> <span class="n">main</span>
<span class="p">}</span>
@@ -287,7 +287,7 @@ Please see the <a href="https://github.com/ra1028/DiffableDataSources/blob/maste
</article>
</div>
<section class="footer">
<p>&copy; 2019 <a class="link" href="https://github.com/ra1028" target="_blank" rel="external">Ryo Aoyama</a>. All rights reserved. (Last updated: 2019-12-10)</p>
<p>&copy; 2021 <a class="link" href="https://github.com/ra1028" target="_blank" rel="external">Ryo Aoyama</a>. All rights reserved. (Last updated: 2021-06-09)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.11.2</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</body>
+1 -1
View File
File diff suppressed because one or more lines are too long