8 Commits

Author SHA1 Message Date
Ryo Aoyama 328894d8da Merge pull request #5 from ra1028/v0.2.0
v0.2.0
2019-09-03 00:01:53 +09:00
Ryo Aoyama 715e0692c4 Update docs 2019-09-02 23:53:26 +09:00
Ryo Aoyama cb3ab8fb41 Update podspec 2019-09-02 23:45:33 +09:00
Ryo Aoyama 72c639ebe7 Fix syntax 2019-09-02 23:42:49 +09:00
Ryo Aoyama 8bd94b65b1 Merge pull request #4 from kishikawakatsumi/typo
Fix typo
2019-09-02 23:40:32 +09:00
Ryo Aoyama ea762adc00 Merge pull request #3 from kishikawakatsumi/class-to-struct
Make `DiffableDataSourceSnapshot` struct
2019-09-02 23:39:27 +09:00
Kishikawa Katsumi d717904e46 Make DiffableDataSourceSnapshot struct
In the latest Xcode 11 (beta 6), DiffableDataSourceSnapshot class changed to a struct.
This PR adopt the API to the latest UIKit's API.
2019-08-26 02:28:25 +09:00
Kishikawa Katsumi dbbea25eac Fix typo 2019-08-25 18:48:26 +09:00
18 changed files with 268 additions and 259 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = 'DiffableDataSources'
spec.version = '0.1.0'
spec.version = '0.2.0'
spec.author = { 'ra1028' => 'r.fe51028.r@gmail.com' }
spec.homepage = 'https://github.com/ra1028/DiffableDataSources'
spec.documentation_url = 'https://ra1028.github.io/DiffableDataSources'
+1 -1
View File
@@ -1,4 +1,4 @@
source "https://rubygems.org"
gem 'cocoapods', '1.7.2'
gem 'cocoapods', '1.7.5'
gem 'jazzy', '0.9.4'
+9 -9
View File
@@ -1,18 +1,18 @@
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (3.0.0)
CFPropertyList (3.0.1)
activesupport (4.2.11.1)
i18n (~> 0.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
atomos (0.1.3)
claide (1.0.2)
cocoapods (1.7.2)
claide (1.0.3)
cocoapods (1.7.5)
activesupport (>= 4.0.2, < 5)
claide (>= 1.0.2, < 2.0)
cocoapods-core (= 1.7.2)
cocoapods-core (= 1.7.5)
cocoapods-deintegrate (>= 1.0.3, < 2.0)
cocoapods-downloader (>= 1.2.2, < 2.0)
cocoapods-plugins (>= 1.0.0, < 2.0)
@@ -28,7 +28,7 @@ GEM
nap (~> 1.0)
ruby-macho (~> 1.4)
xcodeproj (>= 1.10.0, < 2.0)
cocoapods-core (1.7.2)
cocoapods-core (1.7.5)
activesupport (>= 4.0.2, < 6)
fuzzy_match (~> 2.0.4)
nap (~> 1.0)
@@ -38,7 +38,7 @@ GEM
nap
cocoapods-search (1.0.0)
cocoapods-stats (1.1.0)
cocoapods-trunk (1.3.1)
cocoapods-trunk (1.4.0)
nap (>= 0.8, < 2.0)
netrc (~> 0.11)
cocoapods-try (1.1.0)
@@ -46,7 +46,7 @@ GEM
concurrent-ruby (1.1.5)
escape (0.0.4)
ffi (1.11.1)
fourflusher (2.3.0)
fourflusher (2.3.1)
fuzzy_match (2.0.4)
gh_inspector (1.1.3)
i18n (0.9.5)
@@ -85,7 +85,7 @@ GEM
thread_safe (~> 0.1)
xcinvoke (0.3.0)
liferaft (~> 0.0.6)
xcodeproj (1.10.0)
xcodeproj (1.12.0)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)
@@ -96,7 +96,7 @@ PLATFORMS
ruby
DEPENDENCIES
cocoapods (= 1.7.2)
cocoapods (= 1.7.5)
jazzy (= 0.9.4)
BUNDLED WITH
+17 -17
View File
@@ -1,7 +1,7 @@
/// A class for backporting `NSDiffableDataSourceSnapshot` introduced in iOS 13.0+, macOS 10.15+, tvOS 13.0+.
/// Represents the mutable state of diffable data source of UI.
public class DiffableDataSourceSnapshot<SectionIdentifierType: Hashable, ItemIdentifierType: Hashable> {
internal let structure = SnapshotStructure<SectionIdentifierType, ItemIdentifierType>()
public struct DiffableDataSourceSnapshot<SectionIdentifierType: Hashable, ItemIdentifierType: Hashable> {
internal var structure = SnapshotStructure<SectionIdentifierType, ItemIdentifierType>()
/// Creates a new empty snapshot object.
public init() {}
@@ -81,7 +81,7 @@ public class DiffableDataSourceSnapshot<SectionIdentifierType: Hashable, ItemIde
/// - Parameters:
/// - identifiers: The item identifiers to be appended.
/// - sectionIdentifier: An identifier of section to append the given identiciers.
public func appendItems(_ identifiers: [ItemIdentifierType], toSection sectionIdentifier: SectionIdentifierType? = nil) {
public mutating func appendItems(_ identifiers: [ItemIdentifierType], toSection sectionIdentifier: SectionIdentifierType? = nil) {
structure.append(itemIDs: identifiers, to: sectionIdentifier)
}
@@ -90,7 +90,7 @@ public class DiffableDataSourceSnapshot<SectionIdentifierType: Hashable, ItemIde
/// - Parameters:
/// - identifiers: The item identifiers to be inserted.
/// - beforeIdentifier: An identifier of item.
public func insertItems(_ identifiers: [ItemIdentifierType], beforeItem beforeIdentifier: ItemIdentifierType) {
public mutating func insertItems(_ identifiers: [ItemIdentifierType], beforeItem beforeIdentifier: ItemIdentifierType) {
structure.insert(itemIDs: identifiers, before: beforeIdentifier)
}
@@ -99,7 +99,7 @@ public class DiffableDataSourceSnapshot<SectionIdentifierType: Hashable, ItemIde
/// - Parameters:
/// - identifiers: The item identifiers to be inserted.
/// - afterIdentifier: An identifier of item.
public func insertItems(_ identifiers: [ItemIdentifierType], afterItem afterIdentifier: ItemIdentifierType) {
public mutating func insertItems(_ identifiers: [ItemIdentifierType], afterItem afterIdentifier: ItemIdentifierType) {
structure.insert(itemIDs: identifiers, after: afterIdentifier)
}
@@ -107,12 +107,12 @@ public class DiffableDataSourceSnapshot<SectionIdentifierType: Hashable, ItemIde
///
/// - Parameters:
/// - identifiers: The item identifiers to be deleted.
public func deleteItems(_ identifiers: [ItemIdentifierType]) {
public mutating func deleteItems(_ identifiers: [ItemIdentifierType]) {
structure.remove(itemIDs: identifiers)
}
/// Deletes the all items in the snapshot.
public func deleteAllItems() {
public mutating func deleteAllItems() {
structure.removeAllItems()
}
@@ -121,7 +121,7 @@ public class DiffableDataSourceSnapshot<SectionIdentifierType: Hashable, ItemIde
/// - Parameters:
/// - identifier: An item identifier to be moved.
/// - toIdentifier: An identifier of item.
public func moveItem(_ identifier: ItemIdentifierType, beforeItem toIdentifier: ItemIdentifierType) {
public mutating func moveItem(_ identifier: ItemIdentifierType, beforeItem toIdentifier: ItemIdentifierType) {
structure.move(itemID: identifier, before: toIdentifier)
}
@@ -130,7 +130,7 @@ public class DiffableDataSourceSnapshot<SectionIdentifierType: Hashable, ItemIde
/// - Parameters:
/// - identifier: An item identifier to be moved.
/// - toIdentifier: An identifier of item.
public func moveItem(_ identifier: ItemIdentifierType, afterItem toIdentifier: ItemIdentifierType) {
public mutating func moveItem(_ identifier: ItemIdentifierType, afterItem toIdentifier: ItemIdentifierType) {
structure.move(itemID: identifier, after: toIdentifier)
}
@@ -138,7 +138,7 @@ public class DiffableDataSourceSnapshot<SectionIdentifierType: Hashable, ItemIde
///
/// - Parameters:
/// - identifiers: The item identifiers to be reloaded.
public func reloadItems(_ identifiers: [ItemIdentifierType]) {
public mutating func reloadItems(_ identifiers: [ItemIdentifierType]) {
structure.update(itemIDs: identifiers)
}
@@ -146,7 +146,7 @@ public class DiffableDataSourceSnapshot<SectionIdentifierType: Hashable, ItemIde
///
/// - Parameters:
/// - identifiers: The section identifiers to be appended.
public func appendSections(_ identifiers: [SectionIdentifierType]) {
public mutating func appendSections(_ identifiers: [SectionIdentifierType]) {
structure.append(sectionIDs: identifiers)
}
@@ -155,7 +155,7 @@ public class DiffableDataSourceSnapshot<SectionIdentifierType: Hashable, ItemIde
/// - Parameters:
/// - identifiers: The section identifiers to be inserted.
/// - toIdentifier: An identifier of setion.
public func insertSections(_ identifiers: [SectionIdentifierType], beforeSection toIdentifier: SectionIdentifierType) {
public mutating func insertSections(_ identifiers: [SectionIdentifierType], beforeSection toIdentifier: SectionIdentifierType) {
structure.insert(sectionIDs: identifiers, before: toIdentifier)
}
@@ -164,7 +164,7 @@ public class DiffableDataSourceSnapshot<SectionIdentifierType: Hashable, ItemIde
/// - Parameters:
/// - identifiers: The section identifiers to be inserted.
/// - toIdentifier: An identifier of setion.
public func insertSections(_ identifiers: [SectionIdentifierType], afterSection toIdentifier: SectionIdentifierType) {
public mutating func insertSections(_ identifiers: [SectionIdentifierType], afterSection toIdentifier: SectionIdentifierType) {
structure.insert(sectionIDs: identifiers, after: toIdentifier)
}
@@ -172,7 +172,7 @@ public class DiffableDataSourceSnapshot<SectionIdentifierType: Hashable, ItemIde
///
/// - Parameters:
/// - identifiers: The section identifiers to be deleted.
public func deleteSections(_ identifiers: [SectionIdentifierType]) {
public mutating func deleteSections(_ identifiers: [SectionIdentifierType]) {
structure.remove(sectionIDs: identifiers)
}
@@ -181,7 +181,7 @@ public class DiffableDataSourceSnapshot<SectionIdentifierType: Hashable, ItemIde
/// - Parameters:
/// - identifier: A section identifier to be moved.
/// - toIdentifier: An identifier of section.
public func moveSection(_ identifier: SectionIdentifierType, beforeSection toIdentifier: SectionIdentifierType) {
public mutating func moveSection(_ identifier: SectionIdentifierType, beforeSection toIdentifier: SectionIdentifierType) {
structure.move(sectionID: identifier, before: toIdentifier)
}
@@ -190,7 +190,7 @@ public class DiffableDataSourceSnapshot<SectionIdentifierType: Hashable, ItemIde
/// - Parameters:
/// - identifier: A section identifier to be moved.
/// - toIdentifier: An identifier of section.
public func moveSection(_ identifier: SectionIdentifierType, afterSection toIdentifier: SectionIdentifierType) {
public mutating func moveSection(_ identifier: SectionIdentifierType, afterSection toIdentifier: SectionIdentifierType) {
structure.move(sectionID: identifier, after: toIdentifier)
}
@@ -198,7 +198,7 @@ public class DiffableDataSourceSnapshot<SectionIdentifierType: Hashable, ItemIde
///
/// - Parameters:
/// - identifiers: The section identifiers to be reloaded.
public func reloadSections(_ identifiers: [SectionIdentifierType]) {
public mutating func reloadSections(_ identifiers: [SectionIdentifierType]) {
structure.update(sectionIDs: identifiers)
}
}
@@ -48,7 +48,7 @@ final class DiffableDataSourceCore<SectionIdentifierType: Hashable, ItemIdentifi
}
func snapshot() -> DiffableDataSourceSnapshot<SectionIdentifierType, ItemIdentifierType> {
let snapshot = DiffableDataSourceSnapshot<SectionIdentifierType, ItemIdentifierType>()
var snapshot = DiffableDataSourceSnapshot<SectionIdentifierType, ItemIdentifierType>()
snapshot.structure.sections = currentSnapshot.structure.sections
return snapshot
}
+18 -18
View File
@@ -1,7 +1,7 @@
import Foundation
import DifferenceKit
final class SnapshotStructure<SectionID: Hashable, ItemID: Hashable> {
struct SnapshotStructure<SectionID: Hashable, ItemID: Hashable> {
struct Item: Differentiable, Equatable {
var differenceIdentifier: ItemID
var isReloaded: Bool
@@ -68,7 +68,7 @@ final class SnapshotStructure<SectionID: Hashable, ItemID: Hashable> {
return itemPositionMap()[itemID]?.section.differenceIdentifier
}
func append(itemIDs: [ItemID], to sectionID: SectionID? = nil, file: StaticString = #file, line: UInt = #line) {
mutating func append(itemIDs: [ItemID], to sectionID: SectionID? = nil, file: StaticString = #file, line: UInt = #line) {
let index: Array<Section>.Index
if let sectionID = sectionID {
@@ -90,7 +90,7 @@ final class SnapshotStructure<SectionID: Hashable, ItemID: Hashable> {
sections[index].elements.append(contentsOf: items)
}
func insert(itemIDs: [ItemID], before beforeItemID: ItemID, file: StaticString = #file, line: UInt = #line) {
mutating func insert(itemIDs: [ItemID], before beforeItemID: ItemID, file: StaticString = #file, line: UInt = #line) {
guard let itemPosition = itemPositionMap()[beforeItemID] else {
specifiedItemIsNotFound(beforeItemID, file: file, line: line)
}
@@ -99,7 +99,7 @@ final class SnapshotStructure<SectionID: Hashable, ItemID: Hashable> {
sections[itemPosition.sectionIndex].elements.insert(contentsOf: items, at: itemPosition.itemRelativeIndex)
}
func insert(itemIDs: [ItemID], after afterItemID: ItemID, file: StaticString = #file, line: UInt = #line) {
mutating func insert(itemIDs: [ItemID], after afterItemID: ItemID, file: StaticString = #file, line: UInt = #line) {
guard let itemPosition = itemPositionMap()[afterItemID] else {
specifiedItemIsNotFound(afterItemID, file: file, line: line)
}
@@ -109,7 +109,7 @@ final class SnapshotStructure<SectionID: Hashable, ItemID: Hashable> {
sections[itemPosition.sectionIndex].elements.insert(contentsOf: items, at: itemIndex)
}
func remove(itemIDs: [ItemID]) {
mutating func remove(itemIDs: [ItemID]) {
let itemPositionMap = self.itemPositionMap()
var removeIndexSetMap = [Int: IndexSet]()
@@ -128,13 +128,13 @@ final class SnapshotStructure<SectionID: Hashable, ItemID: Hashable> {
}
}
func removeAllItems() {
mutating func removeAllItems() {
for sectionIndex in sections.indices {
sections[sectionIndex].elements.removeAll()
}
}
func move(itemID: ItemID, before beforeItemID: ItemID, file: StaticString = #file, line: UInt = #line) {
mutating func move(itemID: ItemID, before beforeItemID: ItemID, file: StaticString = #file, line: UInt = #line) {
guard let removed = remove(itemID: itemID) else {
specifiedItemIsNotFound(itemID, file: file, line: line)
}
@@ -146,7 +146,7 @@ final class SnapshotStructure<SectionID: Hashable, ItemID: Hashable> {
sections[itemPosition.sectionIndex].elements.insert(removed, at: itemPosition.itemRelativeIndex)
}
func move(itemID: ItemID, after afterItemID: ItemID, file: StaticString = #file, line: UInt = #line) {
mutating func move(itemID: ItemID, after afterItemID: ItemID, file: StaticString = #file, line: UInt = #line) {
guard let removed = remove(itemID: itemID) else {
specifiedItemIsNotFound(itemID, file: file, line: line)
}
@@ -159,7 +159,7 @@ final class SnapshotStructure<SectionID: Hashable, ItemID: Hashable> {
sections[itemPosition.sectionIndex].elements.insert(removed, at: itemIndex)
}
func update(itemIDs: [ItemID], file: StaticString = #file, line: UInt = #line) {
mutating func update(itemIDs: [ItemID], file: StaticString = #file, line: UInt = #line) {
let itemPositionMap = self.itemPositionMap()
for itemID in itemIDs {
@@ -171,12 +171,12 @@ final class SnapshotStructure<SectionID: Hashable, ItemID: Hashable> {
}
}
func append(sectionIDs: [SectionID]) {
mutating func append(sectionIDs: [SectionID]) {
let newSections = sectionIDs.lazy.map(Section.init)
sections.append(contentsOf: newSections)
}
func insert(sectionIDs: [SectionID], before beforeSectionID: SectionID, file: StaticString = #file, line: UInt = #line) {
mutating func insert(sectionIDs: [SectionID], before beforeSectionID: SectionID, file: StaticString = #file, line: UInt = #line) {
guard let sectionIndex = sectionIndex(of: beforeSectionID) else {
specifiedSectionIsNotFound(beforeSectionID, file: file, line: line)
}
@@ -185,7 +185,7 @@ final class SnapshotStructure<SectionID: Hashable, ItemID: Hashable> {
sections.insert(contentsOf: newSections, at: sectionIndex)
}
func insert(sectionIDs: [SectionID], after afterSectionID: SectionID, file: StaticString = #file, line: UInt = #line) {
mutating func insert(sectionIDs: [SectionID], after afterSectionID: SectionID, file: StaticString = #file, line: UInt = #line) {
guard let beforeIndex = sectionIndex(of: afterSectionID) else {
specifiedSectionIsNotFound(afterSectionID, file: file, line: line)
}
@@ -195,13 +195,13 @@ final class SnapshotStructure<SectionID: Hashable, ItemID: Hashable> {
sections.insert(contentsOf: newSections, at: sectionIndex)
}
func remove(sectionIDs: [SectionID]) {
mutating func remove(sectionIDs: [SectionID]) {
for sectionID in sectionIDs {
remove(sectionID: sectionID)
}
}
func move(sectionID: SectionID, before beforeSectionID: SectionID, file: StaticString = #file, line: UInt = #line) {
mutating func move(sectionID: SectionID, before beforeSectionID: SectionID, file: StaticString = #file, line: UInt = #line) {
guard let removed = remove(sectionID: sectionID) else {
specifiedSectionIsNotFound(sectionID, file: file, line: line)
}
@@ -213,7 +213,7 @@ final class SnapshotStructure<SectionID: Hashable, ItemID: Hashable> {
sections.insert(removed, at: sectionIndex)
}
func move(sectionID: SectionID, after afterSectionID: SectionID, file: StaticString = #file, line: UInt = #line) {
mutating func move(sectionID: SectionID, after afterSectionID: SectionID, file: StaticString = #file, line: UInt = #line) {
guard let removed = remove(sectionID: sectionID) else {
specifiedSectionIsNotFound(sectionID, file: file, line: line)
}
@@ -226,7 +226,7 @@ final class SnapshotStructure<SectionID: Hashable, ItemID: Hashable> {
sections.insert(removed, at: sectionIndex)
}
func update(sectionIDs: [SectionID]) {
mutating func update(sectionIDs: [SectionID]) {
for sectionID in sectionIDs {
guard let sectionIndex = sectionIndex(of: sectionID) else {
continue
@@ -250,7 +250,7 @@ private extension SnapshotStructure {
}
@discardableResult
func remove(itemID: ItemID) -> Item? {
mutating func remove(itemID: ItemID) -> Item? {
guard let itemPosition = itemPositionMap()[itemID] else {
return nil
}
@@ -259,7 +259,7 @@ private extension SnapshotStructure {
}
@discardableResult
func remove(sectionID: SectionID) -> Section? {
mutating func remove(sectionID: SectionID) -> Section? {
guard let sectionIndex = sectionIndex(of: sectionID) else {
return nil
}
@@ -20,7 +20,7 @@ final class CocoaCollectionViewDiffableDataSourceTests: XCTestCase {
NSCollectionViewItem()
}
let snapshot = DiffableDataSourceSnapshot<Int, Int>()
var snapshot = DiffableDataSourceSnapshot<Int, Int>()
dataSource.apply(snapshot)
XCTAssertEqual(collectionView.isPerformBatchUpdatesCalledCount, 0)
@@ -50,33 +50,36 @@ final class CocoaCollectionViewDiffableDataSourceTests: XCTestCase {
XCTAssertEqual(snapshot1.sectionIdentifiers, [])
XCTAssertEqual(snapshot1.itemIdentifiers, [])
dataSource.snapshot().appendSections([0, 1, 2])
let snapshot2 = dataSource.snapshot()
XCTAssertEqual(snapshot2.sectionIdentifiers, [])
XCTAssertEqual(snapshot2.itemIdentifiers, [])
var snapshot2 = dataSource.snapshot()
snapshot2.appendSections([0, 1, 2])
let snapshotToApply = DiffableDataSourceSnapshot<Int, Int>()
let snapshot3 = dataSource.snapshot()
XCTAssertEqual(snapshot3.sectionIdentifiers, [])
XCTAssertEqual(snapshot3.itemIdentifiers, [])
var snapshotToApply = DiffableDataSourceSnapshot<Int, Int>()
snapshotToApply.appendSections([0, 1, 2])
snapshotToApply.appendItems([0, 1, 2])
dataSource.apply(snapshotToApply)
let snapshot3 = dataSource.snapshot()
XCTAssertEqual(snapshot3.sectionIdentifiers, [0, 1, 2])
XCTAssertEqual(snapshot3.itemIdentifiers, [0, 1, 2])
dataSource.snapshot().appendSections([3, 4, 5])
let snapshot4 = dataSource.snapshot()
XCTAssertEqual(snapshot4.sectionIdentifiers, [0, 1, 2])
XCTAssertEqual(snapshot4.itemIdentifiers, [0, 1, 2])
snapshot4.appendSections([3, 4, 5])
snapshot4.appendItems([3, 4, 5])
dataSource.apply(snapshot4)
var snapshot5 = dataSource.snapshot()
snapshot5.appendSections([3, 4, 5])
let snapshot5 = dataSource.snapshot()
XCTAssertEqual(snapshot5.sectionIdentifiers, [0, 1, 2, 3, 4, 5])
XCTAssertEqual(snapshot5.itemIdentifiers, [0, 1, 2, 3, 4, 5])
var snapshot6 = dataSource.snapshot()
XCTAssertEqual(snapshot6.sectionIdentifiers, [0, 1, 2])
XCTAssertEqual(snapshot6.itemIdentifiers, [0, 1, 2])
snapshot6.appendSections([3, 4, 5])
snapshot6.appendItems([3, 4, 5])
dataSource.apply(snapshot6)
let snapshot7 = dataSource.snapshot()
XCTAssertEqual(snapshot7.sectionIdentifiers, [0, 1, 2, 3, 4, 5])
XCTAssertEqual(snapshot7.itemIdentifiers, [0, 1, 2, 3, 4, 5])
}
func testItemIdentifier() {
@@ -85,7 +88,7 @@ final class CocoaCollectionViewDiffableDataSourceTests: XCTestCase {
NSCollectionViewItem()
}
let snapshot = DiffableDataSourceSnapshot<Int, Int>()
var snapshot = DiffableDataSourceSnapshot<Int, Int>()
snapshot.appendSections([0, 1, 2])
snapshot.appendItems([0, 1, 2], toSection: 0)
dataSource.apply(snapshot)
@@ -100,7 +103,7 @@ final class CocoaCollectionViewDiffableDataSourceTests: XCTestCase {
NSCollectionViewItem()
}
let snapshot = DiffableDataSourceSnapshot<Int, Int>()
var snapshot = DiffableDataSourceSnapshot<Int, Int>()
snapshot.appendSections([0, 1, 2])
snapshot.appendItems([0, 1, 2], toSection: 0)
dataSource.apply(snapshot)
@@ -117,7 +120,7 @@ final class CocoaCollectionViewDiffableDataSourceTests: XCTestCase {
XCTAssertEqual(dataSource.numberOfSections(in: collectionView), 0)
let snapshot = DiffableDataSourceSnapshot<Int, Int>()
var snapshot = DiffableDataSourceSnapshot<Int, Int>()
snapshot.appendSections([0, 1, 2])
snapshot.appendItems([0, 1, 2], toSection: 0)
dataSource.apply(snapshot)
@@ -131,7 +134,7 @@ final class CocoaCollectionViewDiffableDataSourceTests: XCTestCase {
NSCollectionViewItem()
}
let snapshot = DiffableDataSourceSnapshot<Int, Int>()
var snapshot = DiffableDataSourceSnapshot<Int, Int>()
snapshot.appendSections([0, 1, 2])
snapshot.appendItems([0, 1, 2], toSection: 0)
dataSource.apply(snapshot)
@@ -146,7 +149,7 @@ final class CocoaCollectionViewDiffableDataSourceTests: XCTestCase {
item
}
let snapshot = DiffableDataSourceSnapshot<Int, Int>()
var snapshot = DiffableDataSourceSnapshot<Int, Int>()
snapshot.appendSections([0, 1, 2])
snapshot.appendItems([0, 1, 2], toSection: 0)
dataSource.apply(snapshot)
@@ -20,7 +20,7 @@ final class CollectionViewDiffableDataSourceTests: XCTestCase {
UICollectionViewCell()
}
let snapshot = DiffableDataSourceSnapshot<Int, Int>()
var snapshot = DiffableDataSourceSnapshot<Int, Int>()
dataSource.apply(snapshot)
XCTAssertEqual(collectionView.isPerformBatchUpdatesCalledCount, 0)
@@ -50,33 +50,36 @@ final class CollectionViewDiffableDataSourceTests: XCTestCase {
XCTAssertEqual(snapshot1.sectionIdentifiers, [])
XCTAssertEqual(snapshot1.itemIdentifiers, [])
dataSource.snapshot().appendSections([0, 1, 2])
let snapshot2 = dataSource.snapshot()
XCTAssertEqual(snapshot2.sectionIdentifiers, [])
XCTAssertEqual(snapshot2.itemIdentifiers, [])
var snapshot2 = dataSource.snapshot()
snapshot2.appendSections([0, 1, 2])
let snapshotToApply = DiffableDataSourceSnapshot<Int, Int>()
let snapshot3 = dataSource.snapshot()
XCTAssertEqual(snapshot3.sectionIdentifiers, [])
XCTAssertEqual(snapshot3.itemIdentifiers, [])
var snapshotToApply = DiffableDataSourceSnapshot<Int, Int>()
snapshotToApply.appendSections([0, 1, 2])
snapshotToApply.appendItems([0, 1, 2])
dataSource.apply(snapshotToApply)
let snapshot3 = dataSource.snapshot()
XCTAssertEqual(snapshot3.sectionIdentifiers, [0, 1, 2])
XCTAssertEqual(snapshot3.itemIdentifiers, [0, 1, 2])
dataSource.snapshot().appendSections([3, 4, 5])
let snapshot4 = dataSource.snapshot()
XCTAssertEqual(snapshot4.sectionIdentifiers, [0, 1, 2])
XCTAssertEqual(snapshot4.itemIdentifiers, [0, 1, 2])
snapshot4.appendSections([3, 4, 5])
snapshot4.appendItems([3, 4, 5])
dataSource.apply(snapshot4)
var snapshot5 = dataSource.snapshot()
snapshot5.appendSections([3, 4, 5])
let snapshot5 = dataSource.snapshot()
XCTAssertEqual(snapshot5.sectionIdentifiers, [0, 1, 2, 3, 4, 5])
XCTAssertEqual(snapshot5.itemIdentifiers, [0, 1, 2, 3, 4, 5])
var snapshot6 = dataSource.snapshot()
XCTAssertEqual(snapshot6.sectionIdentifiers, [0, 1, 2])
XCTAssertEqual(snapshot6.itemIdentifiers, [0, 1, 2])
snapshot6.appendSections([3, 4, 5])
snapshot6.appendItems([3, 4, 5])
dataSource.apply(snapshot6)
let snapshot7 = dataSource.snapshot()
XCTAssertEqual(snapshot7.sectionIdentifiers, [0, 1, 2, 3, 4, 5])
XCTAssertEqual(snapshot7.itemIdentifiers, [0, 1, 2, 3, 4, 5])
}
func testItemIdentifier() {
@@ -85,7 +88,7 @@ final class CollectionViewDiffableDataSourceTests: XCTestCase {
UICollectionViewCell()
}
let snapshot = DiffableDataSourceSnapshot<Int, Int>()
var snapshot = DiffableDataSourceSnapshot<Int, Int>()
snapshot.appendSections([0, 1, 2])
snapshot.appendItems([0, 1, 2], toSection: 0)
dataSource.apply(snapshot)
@@ -100,7 +103,7 @@ final class CollectionViewDiffableDataSourceTests: XCTestCase {
UICollectionViewCell()
}
let snapshot = DiffableDataSourceSnapshot<Int, Int>()
var snapshot = DiffableDataSourceSnapshot<Int, Int>()
snapshot.appendSections([0, 1, 2])
snapshot.appendItems([0, 1, 2], toSection: 0)
dataSource.apply(snapshot)
@@ -117,7 +120,7 @@ final class CollectionViewDiffableDataSourceTests: XCTestCase {
XCTAssertEqual(dataSource.numberOfSections(in: collectionView), 0)
let snapshot = DiffableDataSourceSnapshot<Int, Int>()
var snapshot = DiffableDataSourceSnapshot<Int, Int>()
snapshot.appendSections([0, 1, 2])
snapshot.appendItems([0, 1, 2], toSection: 0)
dataSource.apply(snapshot)
@@ -131,7 +134,7 @@ final class CollectionViewDiffableDataSourceTests: XCTestCase {
UICollectionViewCell()
}
let snapshot = DiffableDataSourceSnapshot<Int, Int>()
var snapshot = DiffableDataSourceSnapshot<Int, Int>()
snapshot.appendSections([0, 1, 2])
snapshot.appendItems([0, 1, 2], toSection: 0)
dataSource.apply(snapshot)
@@ -146,7 +149,7 @@ final class CollectionViewDiffableDataSourceTests: XCTestCase {
cell
}
let snapshot = DiffableDataSourceSnapshot<Int, Int>()
var snapshot = DiffableDataSourceSnapshot<Int, Int>()
snapshot.appendSections([0, 1, 2])
snapshot.appendItems([0, 1, 2], toSection: 0)
dataSource.apply(snapshot)
+41 -41
View File
@@ -16,7 +16,7 @@ final class DiffableDataSourceSnapshotTests: XCTestCase {
]
for test in tests {
let snapshot = DiffableDataSourceSnapshot<Int, Int>()
var snapshot = DiffableDataSourceSnapshot<Int, Int>()
snapshot.appendSections(test.initial)
snapshot.appendSections(test.append)
XCTAssertEqual(snapshot.sectionIdentifiers, test.expected)
@@ -33,7 +33,7 @@ final class DiffableDataSourceSnapshotTests: XCTestCase {
]
for test in tests {
let snapshot = DiffableDataSourceSnapshot<Int, Int>()
var snapshot = DiffableDataSourceSnapshot<Int, Int>()
snapshot.appendSections(test.initial)
snapshot.appendSections(test.append)
XCTAssertEqual(snapshot.sectionIdentifiers, test.expected)
@@ -51,7 +51,7 @@ final class DiffableDataSourceSnapshotTests: XCTestCase {
]
for test in tests {
let snapshot = DiffableDataSourceSnapshot<Int, Int>()
var snapshot = DiffableDataSourceSnapshot<Int, Int>()
snapshot.appendSections(test.initial)
snapshot.insertSections(test.insert, beforeSection: test.before)
XCTAssertEqual(snapshot.sectionIdentifiers, test.expected)
@@ -67,7 +67,7 @@ final class DiffableDataSourceSnapshotTests: XCTestCase {
]
for test in tests {
let snapshot = DiffableDataSourceSnapshot<Int, Int>()
var snapshot = DiffableDataSourceSnapshot<Int, Int>()
snapshot.appendSections(test.initial)
snapshot.insertSections(test.insert, beforeSection: test.before)
XCTAssertEqual(snapshot.sectionIdentifiers, test.expected)
@@ -86,7 +86,7 @@ final class DiffableDataSourceSnapshotTests: XCTestCase {
]
for test in tests {
let snapshot = DiffableDataSourceSnapshot<Int, Int>()
var snapshot = DiffableDataSourceSnapshot<Int, Int>()
snapshot.appendSections(test.initial)
snapshot.insertSections(test.insert, afterSection: test.after)
XCTAssertEqual(snapshot.sectionIdentifiers, test.expected)
@@ -102,7 +102,7 @@ final class DiffableDataSourceSnapshotTests: XCTestCase {
]
for test in tests {
let snapshot = DiffableDataSourceSnapshot<Int, Int>()
var snapshot = DiffableDataSourceSnapshot<Int, Int>()
snapshot.appendSections(test.initial)
snapshot.insertSections(test.insert, afterSection: test.after)
XCTAssertEqual(snapshot.sectionIdentifiers, test.expected)
@@ -122,7 +122,7 @@ final class DiffableDataSourceSnapshotTests: XCTestCase {
]
for test in tests {
let snapshot = DiffableDataSourceSnapshot<Int, Int>()
var snapshot = DiffableDataSourceSnapshot<Int, Int>()
snapshot.appendSections(test.initial)
snapshot.deleteSections(test.delete)
XCTAssertEqual(snapshot.sectionIdentifiers, test.expected)
@@ -140,7 +140,7 @@ final class DiffableDataSourceSnapshotTests: XCTestCase {
]
for test in tests {
let snapshot = DiffableDataSourceSnapshot<Int, Int>()
var snapshot = DiffableDataSourceSnapshot<Int, Int>()
snapshot.appendSections(test.initial)
snapshot.moveSection(test.move, beforeSection: test.before)
XCTAssertEqual(snapshot.sectionIdentifiers, test.expected)
@@ -158,7 +158,7 @@ final class DiffableDataSourceSnapshotTests: XCTestCase {
]
for test in tests {
let snapshot = DiffableDataSourceSnapshot<Int, Int>()
var snapshot = DiffableDataSourceSnapshot<Int, Int>()
snapshot.appendSections(test.initial)
snapshot.moveSection(test.move, afterSection: test.after)
XCTAssertEqual(snapshot.sectionIdentifiers, test.expected)
@@ -194,7 +194,7 @@ final class DiffableDataSourceSnapshotTests: XCTestCase {
]
for test in tests {
let snapshot = DiffableDataSourceSnapshot<Int, Int>()
var snapshot = DiffableDataSourceSnapshot<Int, Int>()
snapshot.appendSections(test.initial)
snapshot.reloadSections(test.reload)
XCTAssertEqual(snapshot.sectionIdentifiers, test.initial)
@@ -213,7 +213,7 @@ final class DiffableDataSourceSnapshotTests: XCTestCase {
]
for test in tests {
let snapshot = DiffableDataSourceSnapshot<Int, Int>()
var snapshot = DiffableDataSourceSnapshot<Int, Int>()
snapshot.appendSections([0, 1])
snapshot.appendItems(test.initial)
snapshot.appendItems(test.append)
@@ -231,7 +231,7 @@ final class DiffableDataSourceSnapshotTests: XCTestCase {
]
for test in tests {
let snapshot = DiffableDataSourceSnapshot<Int, Int>()
var snapshot = DiffableDataSourceSnapshot<Int, Int>()
snapshot.appendSections([0, 1])
snapshot.appendItems(test.initial)
snapshot.appendItems(test.append)
@@ -253,7 +253,7 @@ final class DiffableDataSourceSnapshotTests: XCTestCase {
]
for test in tests {
let snapshot = DiffableDataSourceSnapshot<Int, Int>()
var snapshot = DiffableDataSourceSnapshot<Int, Int>()
for (section, items) in test.initial.enumerated() {
snapshot.appendSections([section])
snapshot.appendItems(items)
@@ -276,7 +276,7 @@ final class DiffableDataSourceSnapshotTests: XCTestCase {
]
for test in tests {
let snapshot = DiffableDataSourceSnapshot<Int, Int>()
var snapshot = DiffableDataSourceSnapshot<Int, Int>()
for (section, items) in test.initial.enumerated() {
snapshot.appendSections([section])
snapshot.appendItems(items)
@@ -302,7 +302,7 @@ final class DiffableDataSourceSnapshotTests: XCTestCase {
]
for test in tests {
let snapshot = DiffableDataSourceSnapshot<Int, Int>()
var snapshot = DiffableDataSourceSnapshot<Int, Int>()
snapshot.appendSections([0, 1])
snapshot.appendItems(test.initial)
snapshot.insertItems(test.insert, beforeItem: test.before)
@@ -320,7 +320,7 @@ final class DiffableDataSourceSnapshotTests: XCTestCase {
]
for test in tests {
let snapshot = DiffableDataSourceSnapshot<Int, Int>()
var snapshot = DiffableDataSourceSnapshot<Int, Int>()
snapshot.appendSections([0, 1])
snapshot.appendItems(test.initial)
snapshot.insertItems(test.insert, beforeItem: test.before)
@@ -341,7 +341,7 @@ final class DiffableDataSourceSnapshotTests: XCTestCase {
]
for test in tests {
let snapshot = DiffableDataSourceSnapshot<Int, Int>()
var snapshot = DiffableDataSourceSnapshot<Int, Int>()
snapshot.appendSections([0, 1])
snapshot.appendItems(test.initial)
snapshot.insertItems(test.insert, afterItem: test.after)
@@ -359,7 +359,7 @@ final class DiffableDataSourceSnapshotTests: XCTestCase {
]
for test in tests {
let snapshot = DiffableDataSourceSnapshot<Int, Int>()
var snapshot = DiffableDataSourceSnapshot<Int, Int>()
snapshot.appendSections([0, 1])
snapshot.appendItems(test.initial)
snapshot.insertItems(test.insert, afterItem: test.after)
@@ -382,7 +382,7 @@ final class DiffableDataSourceSnapshotTests: XCTestCase {
]
for test in tests {
let snapshot = DiffableDataSourceSnapshot<Int, Int>()
var snapshot = DiffableDataSourceSnapshot<Int, Int>()
for (section, items) in test.initial.enumerated() {
snapshot.appendSections([section])
snapshot.appendItems(items, toSection: section)
@@ -409,7 +409,7 @@ final class DiffableDataSourceSnapshotTests: XCTestCase {
]
for test in tests {
let snapshot = DiffableDataSourceSnapshot<Int, Int>()
var snapshot = DiffableDataSourceSnapshot<Int, Int>()
for (section, items) in test.enumerated() {
snapshot.appendSections([section])
snapshot.appendItems(items, toSection: section)
@@ -435,7 +435,7 @@ final class DiffableDataSourceSnapshotTests: XCTestCase {
]
for test in tests {
let snapshot = DiffableDataSourceSnapshot<Int, Int>()
var snapshot = DiffableDataSourceSnapshot<Int, Int>()
for (section, items) in test.initial.enumerated() {
snapshot.appendSections([section])
snapshot.appendItems(items, toSection: section)
@@ -463,7 +463,7 @@ final class DiffableDataSourceSnapshotTests: XCTestCase {
]
for test in tests {
let snapshot = DiffableDataSourceSnapshot<Int, Int>()
var snapshot = DiffableDataSourceSnapshot<Int, Int>()
for (section, items) in test.initial.enumerated() {
snapshot.appendSections([section])
snapshot.appendItems(items, toSection: section)
@@ -539,7 +539,7 @@ final class DiffableDataSourceSnapshotTests: XCTestCase {
]
for test in tests {
let snapshot = DiffableDataSourceSnapshot<Int, Int>()
var snapshot = DiffableDataSourceSnapshot<Int, Int>()
for (section, items) in test.initial.enumerated() {
snapshot.appendSections([section])
snapshot.appendItems(items, toSection: section)
@@ -564,7 +564,7 @@ final class DiffableDataSourceSnapshotTests: XCTestCase {
]
for test in tests {
let snapshot = DiffableDataSourceSnapshot<Int, Int>()
var snapshot = DiffableDataSourceSnapshot<Int, Int>()
for (section, items) in test.initial.enumerated() {
snapshot.appendSections([section])
snapshot.appendItems(items, toSection: section)
@@ -583,7 +583,7 @@ final class DiffableDataSourceSnapshotTests: XCTestCase {
]
for test in tests {
let snapshot = DiffableDataSourceSnapshot<Int, Int>()
var snapshot = DiffableDataSourceSnapshot<Int, Int>()
for (section, items) in test.initial.enumerated() {
snapshot.appendSections([section])
snapshot.appendItems(items, toSection: section)
@@ -602,7 +602,7 @@ final class DiffableDataSourceSnapshotTests: XCTestCase {
]
for test in tests {
let snapshot = DiffableDataSourceSnapshot<Int, Int>()
var snapshot = DiffableDataSourceSnapshot<Int, Int>()
snapshot.appendSections(test.initial)
XCTAssertEqual(snapshot.numberOfSections, test.expected)
@@ -618,7 +618,7 @@ final class DiffableDataSourceSnapshotTests: XCTestCase {
]
for test in tests {
let snapshot = DiffableDataSourceSnapshot<Int, Int>()
var snapshot = DiffableDataSourceSnapshot<Int, Int>()
snapshot.appendSections(test.initial)
XCTAssertEqual(snapshot.numberOfSections, test.expected)
@@ -636,7 +636,7 @@ final class DiffableDataSourceSnapshotTests: XCTestCase {
]
for test in tests {
let snapshot = DiffableDataSourceSnapshot<Int, Int>()
var snapshot = DiffableDataSourceSnapshot<Int, Int>()
for (section, items) in test.initial.enumerated() {
snapshot.appendSections([section])
snapshot.appendItems(items, toSection: section)
@@ -655,7 +655,7 @@ final class DiffableDataSourceSnapshotTests: XCTestCase {
]
for test in tests {
let snapshot = DiffableDataSourceSnapshot<Int, Int>()
var snapshot = DiffableDataSourceSnapshot<Int, Int>()
for (section, items) in test.initial.enumerated() {
snapshot.appendSections([section])
snapshot.appendItems(items, toSection: section)
@@ -674,7 +674,7 @@ final class DiffableDataSourceSnapshotTests: XCTestCase {
]
for test in tests {
let snapshot = DiffableDataSourceSnapshot<Int, Int>()
var snapshot = DiffableDataSourceSnapshot<Int, Int>()
snapshot.appendSections(test.initial)
XCTAssertEqual(snapshot.sectionIdentifiers, test.expected)
@@ -690,7 +690,7 @@ final class DiffableDataSourceSnapshotTests: XCTestCase {
]
for test in tests {
let snapshot = DiffableDataSourceSnapshot<Int, Int>()
var snapshot = DiffableDataSourceSnapshot<Int, Int>()
snapshot.appendSections(test.initial)
XCTAssertEqual(snapshot.sectionIdentifiers, test.expected)
@@ -708,7 +708,7 @@ final class DiffableDataSourceSnapshotTests: XCTestCase {
]
for test in tests {
let snapshot = DiffableDataSourceSnapshot<Int, Int>()
var snapshot = DiffableDataSourceSnapshot<Int, Int>()
for (section, items) in test.initial.enumerated() {
snapshot.appendSections([section])
snapshot.appendItems(items, toSection: section)
@@ -727,7 +727,7 @@ final class DiffableDataSourceSnapshotTests: XCTestCase {
]
for test in tests {
let snapshot = DiffableDataSourceSnapshot<Int, Int>()
var snapshot = DiffableDataSourceSnapshot<Int, Int>()
for (section, items) in test.initial.enumerated() {
snapshot.appendSections([section])
snapshot.appendItems(items, toSection: section)
@@ -748,7 +748,7 @@ final class DiffableDataSourceSnapshotTests: XCTestCase {
]
for test in tests {
let snapshot = DiffableDataSourceSnapshot<Int, Int>()
var snapshot = DiffableDataSourceSnapshot<Int, Int>()
for (section, items) in test.initial.enumerated() {
snapshot.appendSections([section])
snapshot.appendItems(items, toSection: section)
@@ -767,7 +767,7 @@ final class DiffableDataSourceSnapshotTests: XCTestCase {
]
for test in tests {
let snapshot = DiffableDataSourceSnapshot<Int, Int>()
var snapshot = DiffableDataSourceSnapshot<Int, Int>()
for (section, items) in test.initial.enumerated() {
snapshot.appendSections([section])
snapshot.appendItems(items, toSection: section)
@@ -789,7 +789,7 @@ final class DiffableDataSourceSnapshotTests: XCTestCase {
]
for test in tests {
let snapshot = DiffableDataSourceSnapshot<Int, Int>()
var snapshot = DiffableDataSourceSnapshot<Int, Int>()
for (section, items) in test.initial.enumerated() {
snapshot.appendSections([section])
snapshot.appendItems(items, toSection: section)
@@ -808,7 +808,7 @@ final class DiffableDataSourceSnapshotTests: XCTestCase {
]
for test in tests {
let snapshot = DiffableDataSourceSnapshot<Int, Int>()
var snapshot = DiffableDataSourceSnapshot<Int, Int>()
for (section, items) in test.initial.enumerated() {
snapshot.appendSections([section])
snapshot.appendItems(items, toSection: section)
@@ -830,7 +830,7 @@ final class DiffableDataSourceSnapshotTests: XCTestCase {
]
for test in tests {
let snapshot = DiffableDataSourceSnapshot<Int, Int>()
var snapshot = DiffableDataSourceSnapshot<Int, Int>()
for (section, items) in test.initial.enumerated() {
snapshot.appendSections([section])
snapshot.appendItems(items, toSection: section)
@@ -849,7 +849,7 @@ final class DiffableDataSourceSnapshotTests: XCTestCase {
]
for test in tests {
let snapshot = DiffableDataSourceSnapshot<Int, Int>()
var snapshot = DiffableDataSourceSnapshot<Int, Int>()
for (section, items) in test.initial.enumerated() {
snapshot.appendSections([section])
snapshot.appendItems(items, toSection: section)
@@ -870,7 +870,7 @@ final class DiffableDataSourceSnapshotTests: XCTestCase {
]
for test in tests {
let snapshot = DiffableDataSourceSnapshot<Int, Int>()
var snapshot = DiffableDataSourceSnapshot<Int, Int>()
snapshot.appendSections(test.initial)
XCTAssertEqual(snapshot.indexOfSection(test.section), test.expectedIndex)
@@ -886,7 +886,7 @@ final class DiffableDataSourceSnapshotTests: XCTestCase {
]
for test in tests {
let snapshot = DiffableDataSourceSnapshot<Int, Int>()
var snapshot = DiffableDataSourceSnapshot<Int, Int>()
snapshot.appendSections(test.initial)
XCTAssertEqual(snapshot.indexOfSection(test.section), test.expectedIndex)
+26 -23
View File
@@ -20,7 +20,7 @@ final class TableViewDiffableDataSourceTests: XCTestCase {
UITableViewCell()
}
let snapshot = DiffableDataSourceSnapshot<Int, Int>()
var snapshot = DiffableDataSourceSnapshot<Int, Int>()
dataSource.apply(snapshot)
XCTAssertEqual(tableView.isPerformBatchUpdatesCalledCount, 0)
@@ -50,33 +50,36 @@ final class TableViewDiffableDataSourceTests: XCTestCase {
XCTAssertEqual(snapshot1.sectionIdentifiers, [])
XCTAssertEqual(snapshot1.itemIdentifiers, [])
dataSource.snapshot().appendSections([0, 1, 2])
let snapshot2 = dataSource.snapshot()
XCTAssertEqual(snapshot2.sectionIdentifiers, [])
XCTAssertEqual(snapshot2.itemIdentifiers, [])
var snapshot2 = dataSource.snapshot()
snapshot2.appendSections([0, 1, 2])
let snapshotToApply = DiffableDataSourceSnapshot<Int, Int>()
let snapshot3 = dataSource.snapshot()
XCTAssertEqual(snapshot3.sectionIdentifiers, [])
XCTAssertEqual(snapshot3.itemIdentifiers, [])
var snapshotToApply = DiffableDataSourceSnapshot<Int, Int>()
snapshotToApply.appendSections([0, 1, 2])
snapshotToApply.appendItems([0, 1, 2])
dataSource.apply(snapshotToApply)
let snapshot3 = dataSource.snapshot()
XCTAssertEqual(snapshot3.sectionIdentifiers, [0, 1, 2])
XCTAssertEqual(snapshot3.itemIdentifiers, [0, 1, 2])
dataSource.snapshot().appendSections([3, 4, 5])
let snapshot4 = dataSource.snapshot()
XCTAssertEqual(snapshot4.sectionIdentifiers, [0, 1, 2])
XCTAssertEqual(snapshot4.itemIdentifiers, [0, 1, 2])
snapshot4.appendSections([3, 4, 5])
snapshot4.appendItems([3, 4, 5])
dataSource.apply(snapshot4)
var snapshot5 = dataSource.snapshot()
snapshot5.appendSections([3, 4, 5])
let snapshot5 = dataSource.snapshot()
XCTAssertEqual(snapshot5.sectionIdentifiers, [0, 1, 2, 3, 4, 5])
XCTAssertEqual(snapshot5.itemIdentifiers, [0, 1, 2, 3, 4, 5])
var snapshot6 = dataSource.snapshot()
XCTAssertEqual(snapshot6.sectionIdentifiers, [0, 1, 2])
XCTAssertEqual(snapshot6.itemIdentifiers, [0, 1, 2])
snapshot6.appendSections([3, 4, 5])
snapshot6.appendItems([3, 4, 5])
dataSource.apply(snapshot6)
let snapshot7 = dataSource.snapshot()
XCTAssertEqual(snapshot7.sectionIdentifiers, [0, 1, 2, 3, 4, 5])
XCTAssertEqual(snapshot7.itemIdentifiers, [0, 1, 2, 3, 4, 5])
}
func testItemIdentifier() {
@@ -85,7 +88,7 @@ final class TableViewDiffableDataSourceTests: XCTestCase {
UITableViewCell()
}
let snapshot = DiffableDataSourceSnapshot<Int, Int>()
var snapshot = DiffableDataSourceSnapshot<Int, Int>()
snapshot.appendSections([0, 1, 2])
snapshot.appendItems([0, 1, 2], toSection: 0)
dataSource.apply(snapshot)
@@ -100,7 +103,7 @@ final class TableViewDiffableDataSourceTests: XCTestCase {
UITableViewCell()
}
let snapshot = DiffableDataSourceSnapshot<Int, Int>()
var snapshot = DiffableDataSourceSnapshot<Int, Int>()
snapshot.appendSections([0, 1, 2])
snapshot.appendItems([0, 1, 2], toSection: 0)
dataSource.apply(snapshot)
@@ -117,7 +120,7 @@ final class TableViewDiffableDataSourceTests: XCTestCase {
XCTAssertEqual(dataSource.numberOfSections(in: tableView), 0)
let snapshot = DiffableDataSourceSnapshot<Int, Int>()
var snapshot = DiffableDataSourceSnapshot<Int, Int>()
snapshot.appendSections([0, 1, 2])
snapshot.appendItems([0, 1, 2], toSection: 0)
dataSource.apply(snapshot)
@@ -131,7 +134,7 @@ final class TableViewDiffableDataSourceTests: XCTestCase {
UITableViewCell()
}
let snapshot = DiffableDataSourceSnapshot<Int, Int>()
var snapshot = DiffableDataSourceSnapshot<Int, Int>()
snapshot.appendSections([0, 1, 2])
snapshot.appendItems([0, 1, 2], toSection: 0)
dataSource.apply(snapshot)
@@ -146,7 +149,7 @@ final class TableViewDiffableDataSourceTests: XCTestCase {
cell
}
let snapshot = DiffableDataSourceSnapshot<Int, Int>()
var snapshot = DiffableDataSourceSnapshot<Int, Int>()
snapshot.appendSections([0, 1, 2])
snapshot.appendItems([0, 1, 2], toSection: 0)
dataSource.apply(snapshot)
+1 -1
View File
@@ -20,7 +20,7 @@ jobs:
set -o pipefail &&
xcodebuild build-for-testing test-without-building -workspace DiffableDataSources.xcworkspace -scheme DiffableDataSources -configuration Release ENABLE_TESTABILITY=YES |
xcpretty -c -r junit -o build/reports/xcodebuild-macOS.xml
displayName: xcodebuild test maxOS
displayName: xcodebuild test macOS
condition: succeededOrFailed()
- script: |
set -o pipefail &&
@@ -65,7 +65,7 @@
<a class="nav-group-name-link" href="../Snapshot.html">Snapshot</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/DiffableDataSourceSnapshot.html">DiffableDataSourceSnapshot</a>
<a class="nav-group-task-link" href="../Structs/DiffableDataSourceSnapshot.html">DiffableDataSourceSnapshot</a>
</li>
</ul>
</li>
@@ -235,9 +235,9 @@ changes with automatic diffing.</p>
<li class="item">
<div>
<code>
<a name="/s:19DiffableDataSources014CollectionViewaB6SourceC5apply_20animatingDifferencesyAA0abF8SnapshotCyxq_G_SbtF"></a>
<a name="/s:19DiffableDataSources014CollectionViewaB6SourceC5apply_20animatingDifferencesyAA0abF8SnapshotVyxq_G_SbtF"></a>
<a name="//apple_ref/swift/Method/apply(_:animatingDifferences:)" class="dashAnchor"></a>
<a class="token" href="#/s:19DiffableDataSources014CollectionViewaB6SourceC5apply_20animatingDifferencesyAA0abF8SnapshotCyxq_G_SbtF">apply(_:animatingDifferences:)</a>
<a class="token" href="#/s:19DiffableDataSources014CollectionViewaB6SourceC5apply_20animatingDifferencesyAA0abF8SnapshotVyxq_G_SbtF">apply(_:animatingDifferences:)</a>
</code>
</div>
<div class="height-container">
@@ -252,7 +252,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="kd">func</span> <span class="nf">apply</span><span class="p">(</span><span class="n">_</span> <span class="nv">snapshot</span><span class="p">:</span> <span class="kt"><a href="../Classes/DiffableDataSourceSnapshot.html">DiffableDataSourceSnapshot</a></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="p">,</span> <span class="nv">animatingDifferences</span><span class="p">:</span> <span class="kt">Bool</span> <span class="o">=</span> <span class="kc">true</span><span class="p">)</span></code></pre>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">apply</span><span class="p">(</span><span class="n">_</span> <span class="nv">snapshot</span><span class="p">:</span> <span class="kt"><a href="../Structs/DiffableDataSourceSnapshot.html">DiffableDataSourceSnapshot</a></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="p">,</span> <span class="nv">animatingDifferences</span><span class="p">:</span> <span class="kt">Bool</span> <span class="o">=</span> <span class="kc">true</span><span class="p">)</span></code></pre>
</div>
</div>
@@ -294,9 +294,9 @@ changes with automatic diffing.</p>
<li class="item">
<div>
<code>
<a name="/s:19DiffableDataSources014CollectionViewaB6SourceC8snapshotAA0abF8SnapshotCyxq_GyF"></a>
<a name="/s:19DiffableDataSources014CollectionViewaB6SourceC8snapshotAA0abF8SnapshotVyxq_GyF"></a>
<a name="//apple_ref/swift/Method/snapshot()" class="dashAnchor"></a>
<a class="token" href="#/s:19DiffableDataSources014CollectionViewaB6SourceC8snapshotAA0abF8SnapshotCyxq_GyF">snapshot()</a>
<a class="token" href="#/s:19DiffableDataSources014CollectionViewaB6SourceC8snapshotAA0abF8SnapshotVyxq_GyF">snapshot()</a>
</code>
</div>
<div class="height-container">
@@ -311,7 +311,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="kd">func</span> <span class="nf">snapshot</span><span class="p">()</span> <span class="o">-&gt;</span> <span class="kt"><a href="../Classes/DiffableDataSourceSnapshot.html">DiffableDataSourceSnapshot</a></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></code></pre>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">snapshot</span><span class="p">()</span> <span class="o">-&gt;</span> <span class="kt"><a href="../Structs/DiffableDataSourceSnapshot.html">DiffableDataSourceSnapshot</a></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></code></pre>
</div>
</div>
@@ -678,7 +678,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-06-24)</p>
<p>&copy; 2019 <a class="link" href="https://github.com/ra1028" target="_blank" rel="external">Ryo Aoyama</a>. All rights reserved. (Last updated: 2019-09-02)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.4</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</body>
@@ -65,7 +65,7 @@
<a class="nav-group-name-link" href="../Snapshot.html">Snapshot</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/DiffableDataSourceSnapshot.html">DiffableDataSourceSnapshot</a>
<a class="nav-group-task-link" href="../Structs/DiffableDataSourceSnapshot.html">DiffableDataSourceSnapshot</a>
</li>
</ul>
</li>
@@ -208,9 +208,9 @@ changes with automatic diffing.</p>
<li class="item">
<div>
<code>
<a name="/s:19DiffableDataSources09TableViewaB6SourceC5apply_20animatingDifferencesyAA0abF8SnapshotCyxq_G_SbtF"></a>
<a name="/s:19DiffableDataSources09TableViewaB6SourceC5apply_20animatingDifferencesyAA0abF8SnapshotVyxq_G_SbtF"></a>
<a name="//apple_ref/swift/Method/apply(_:animatingDifferences:)" class="dashAnchor"></a>
<a class="token" href="#/s:19DiffableDataSources09TableViewaB6SourceC5apply_20animatingDifferencesyAA0abF8SnapshotCyxq_G_SbtF">apply(_:animatingDifferences:)</a>
<a class="token" href="#/s:19DiffableDataSources09TableViewaB6SourceC5apply_20animatingDifferencesyAA0abF8SnapshotVyxq_G_SbtF">apply(_:animatingDifferences:)</a>
</code>
</div>
<div class="height-container">
@@ -225,7 +225,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="kd">func</span> <span class="nf">apply</span><span class="p">(</span><span class="n">_</span> <span class="nv">snapshot</span><span class="p">:</span> <span class="kt"><a href="../Classes/DiffableDataSourceSnapshot.html">DiffableDataSourceSnapshot</a></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="p">,</span> <span class="nv">animatingDifferences</span><span class="p">:</span> <span class="kt">Bool</span> <span class="o">=</span> <span class="kc">true</span><span class="p">)</span></code></pre>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">apply</span><span class="p">(</span><span class="n">_</span> <span class="nv">snapshot</span><span class="p">:</span> <span class="kt"><a href="../Structs/DiffableDataSourceSnapshot.html">DiffableDataSourceSnapshot</a></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="p">,</span> <span class="nv">animatingDifferences</span><span class="p">:</span> <span class="kt">Bool</span> <span class="o">=</span> <span class="kc">true</span><span class="p">)</span></code></pre>
</div>
</div>
@@ -267,9 +267,9 @@ changes with automatic diffing.</p>
<li class="item">
<div>
<code>
<a name="/s:19DiffableDataSources09TableViewaB6SourceC8snapshotAA0abF8SnapshotCyxq_GyF"></a>
<a name="/s:19DiffableDataSources09TableViewaB6SourceC8snapshotAA0abF8SnapshotVyxq_GyF"></a>
<a name="//apple_ref/swift/Method/snapshot()" class="dashAnchor"></a>
<a class="token" href="#/s:19DiffableDataSources09TableViewaB6SourceC8snapshotAA0abF8SnapshotCyxq_GyF">snapshot()</a>
<a class="token" href="#/s:19DiffableDataSources09TableViewaB6SourceC8snapshotAA0abF8SnapshotVyxq_GyF">snapshot()</a>
</code>
</div>
<div class="height-container">
@@ -284,7 +284,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="kd">func</span> <span class="nf">snapshot</span><span class="p">()</span> <span class="o">-&gt;</span> <span class="kt"><a href="../Classes/DiffableDataSourceSnapshot.html">DiffableDataSourceSnapshot</a></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></code></pre>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">snapshot</span><span class="p">()</span> <span class="o">-&gt;</span> <span class="kt"><a href="../Structs/DiffableDataSourceSnapshot.html">DiffableDataSourceSnapshot</a></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></code></pre>
</div>
</div>
@@ -577,7 +577,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-06-24)</p>
<p>&copy; 2019 <a class="link" href="https://github.com/ra1028" target="_blank" rel="external">Ryo Aoyama</a>. All rights reserved. (Last updated: 2019-09-02)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.4</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</body>
+2 -2
View File
@@ -65,7 +65,7 @@
<a class="nav-group-name-link" href="Snapshot.html">Snapshot</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/DiffableDataSourceSnapshot.html">DiffableDataSourceSnapshot</a>
<a class="nav-group-task-link" href="Structs/DiffableDataSourceSnapshot.html">DiffableDataSourceSnapshot</a>
</li>
</ul>
</li>
@@ -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-06-24)</p>
<p>&copy; 2019 <a class="link" href="https://github.com/ra1028" target="_blank" rel="external">Ryo Aoyama</a>. All rights reserved. (Last updated: 2019-09-02)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.4</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</body>
+7 -7
View File
@@ -65,7 +65,7 @@
<a class="nav-group-name-link" href="Snapshot.html">Snapshot</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/DiffableDataSourceSnapshot.html">DiffableDataSourceSnapshot</a>
<a class="nav-group-task-link" href="Structs/DiffableDataSourceSnapshot.html">DiffableDataSourceSnapshot</a>
</li>
</ul>
</li>
@@ -87,9 +87,9 @@
<li class="item">
<div>
<code>
<a name="/s:19DiffableDataSources0aB14SourceSnapshotC"></a>
<a name="//apple_ref/swift/Class/DiffableDataSourceSnapshot" class="dashAnchor"></a>
<a class="token" href="#/s:19DiffableDataSources0aB14SourceSnapshotC">DiffableDataSourceSnapshot</a>
<a name="/s:19DiffableDataSources0aB14SourceSnapshotV"></a>
<a name="//apple_ref/swift/Struct/DiffableDataSourceSnapshot" class="dashAnchor"></a>
<a class="token" href="#/s:19DiffableDataSources0aB14SourceSnapshotV">DiffableDataSourceSnapshot</a>
</code>
</div>
<div class="height-container">
@@ -100,13 +100,13 @@
<p>A class for backporting <code>NSDiffableDataSourceSnapshot</code> introduced in iOS 13.0+, macOS 10.15+, tvOS 13.0+.
Represents the mutable state of diffable data source of UI.</p>
<a href="Classes/DiffableDataSourceSnapshot.html" class="slightly-smaller">See more</a>
<a href="Structs/DiffableDataSourceSnapshot.html" class="slightly-smaller">See more</a>
</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">class</span> <span class="kt">DiffableDataSourceSnapshot</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="k">where</span> <span class="kt">SectionIdentifierType</span> <span class="p">:</span> <span class="kt">Hashable</span><span class="p">,</span> <span class="kt">ItemIdentifierType</span> <span class="p">:</span> <span class="kt">Hashable</span></code></pre>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">DiffableDataSourceSnapshot</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="k">where</span> <span class="kt">SectionIdentifierType</span> <span class="p">:</span> <span class="kt">Hashable</span><span class="p">,</span> <span class="kt">ItemIdentifierType</span> <span class="p">:</span> <span class="kt">Hashable</span></code></pre>
</div>
</div>
@@ -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-06-24)</p>
<p>&copy; 2019 <a class="link" href="https://github.com/ra1028" target="_blank" rel="external">Ryo Aoyama</a>. All rights reserved. (Last updated: 2019-09-02)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.4</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</body>
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>DiffableDataSourceSnapshot Class Reference</title>
<title>DiffableDataSourceSnapshot Structure 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">
@@ -14,9 +14,9 @@
</head>
<body>
<a name="//apple_ref/swift/Class/DiffableDataSourceSnapshot" class="dashAnchor"></a>
<a name="//apple_ref/swift/Struct/DiffableDataSourceSnapshot" class="dashAnchor"></a>
<a title="DiffableDataSourceSnapshot Class Reference"></a>
<a title="DiffableDataSourceSnapshot Structure Reference"></a>
<header class="header">
<p class="header-col header-col--primary">
@@ -44,7 +44,7 @@
<p class="breadcrumbs">
<a class="breadcrumb" href="../index.html">DiffableDataSources Reference</a>
<img class="carat" src="../img/carat.png" />
DiffableDataSourceSnapshot Class Reference
DiffableDataSourceSnapshot Structure Reference
</p>
<div class="content-wrapper">
@@ -65,7 +65,7 @@
<a class="nav-group-name-link" href="../Snapshot.html">Snapshot</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Classes/DiffableDataSourceSnapshot.html">DiffableDataSourceSnapshot</a>
<a class="nav-group-task-link" href="../Structs/DiffableDataSourceSnapshot.html">DiffableDataSourceSnapshot</a>
</li>
</ul>
</li>
@@ -78,7 +78,7 @@
<h1>DiffableDataSourceSnapshot</h1>
<div class="declaration">
<div class="language">
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">DiffableDataSourceSnapshot</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="k">where</span> <span class="kt">SectionIdentifierType</span> <span class="p">:</span> <span class="kt">Hashable</span><span class="p">,</span> <span class="kt">ItemIdentifierType</span> <span class="p">:</span> <span class="kt">Hashable</span></code></pre>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">DiffableDataSourceSnapshot</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="k">where</span> <span class="kt">SectionIdentifierType</span> <span class="p">:</span> <span class="kt">Hashable</span><span class="p">,</span> <span class="kt">ItemIdentifierType</span> <span class="p">:</span> <span class="kt">Hashable</span></code></pre>
</div>
</div>
@@ -95,9 +95,9 @@ Represents the mutable state of diffable data source of UI.</p>
<li class="item">
<div>
<code>
<a name="/s:19DiffableDataSources0aB14SourceSnapshotCACyxq_Gycfc"></a>
<a name="/s:19DiffableDataSources0aB14SourceSnapshotVACyxq_Gycfc"></a>
<a name="//apple_ref/swift/Method/init()" class="dashAnchor"></a>
<a class="token" href="#/s:19DiffableDataSources0aB14SourceSnapshotCACyxq_Gycfc">init()</a>
<a class="token" href="#/s:19DiffableDataSources0aB14SourceSnapshotVACyxq_Gycfc">init()</a>
</code>
</div>
<div class="height-container">
@@ -122,9 +122,9 @@ Represents the mutable state of diffable data source of UI.</p>
<li class="item">
<div>
<code>
<a name="/s:19DiffableDataSources0aB14SourceSnapshotC13numberOfItemsSivp"></a>
<a name="/s:19DiffableDataSources0aB14SourceSnapshotV13numberOfItemsSivp"></a>
<a name="//apple_ref/swift/Property/numberOfItems" class="dashAnchor"></a>
<a class="token" href="#/s:19DiffableDataSources0aB14SourceSnapshotC13numberOfItemsSivp">numberOfItems</a>
<a class="token" href="#/s:19DiffableDataSources0aB14SourceSnapshotV13numberOfItemsSivp">numberOfItems</a>
</code>
</div>
<div class="height-container">
@@ -149,9 +149,9 @@ Represents the mutable state of diffable data source of UI.</p>
<li class="item">
<div>
<code>
<a name="/s:19DiffableDataSources0aB14SourceSnapshotC16numberOfSectionsSivp"></a>
<a name="/s:19DiffableDataSources0aB14SourceSnapshotV16numberOfSectionsSivp"></a>
<a name="//apple_ref/swift/Property/numberOfSections" class="dashAnchor"></a>
<a class="token" href="#/s:19DiffableDataSources0aB14SourceSnapshotC16numberOfSectionsSivp">numberOfSections</a>
<a class="token" href="#/s:19DiffableDataSources0aB14SourceSnapshotV16numberOfSectionsSivp">numberOfSections</a>
</code>
</div>
<div class="height-container">
@@ -176,9 +176,9 @@ Represents the mutable state of diffable data source of UI.</p>
<li class="item">
<div>
<code>
<a name="/s:19DiffableDataSources0aB14SourceSnapshotC18sectionIdentifiersSayxGvp"></a>
<a name="/s:19DiffableDataSources0aB14SourceSnapshotV18sectionIdentifiersSayxGvp"></a>
<a name="//apple_ref/swift/Property/sectionIdentifiers" class="dashAnchor"></a>
<a class="token" href="#/s:19DiffableDataSources0aB14SourceSnapshotC18sectionIdentifiersSayxGvp">sectionIdentifiers</a>
<a class="token" href="#/s:19DiffableDataSources0aB14SourceSnapshotV18sectionIdentifiersSayxGvp">sectionIdentifiers</a>
</code>
</div>
<div class="height-container">
@@ -203,9 +203,9 @@ Represents the mutable state of diffable data source of UI.</p>
<li class="item">
<div>
<code>
<a name="/s:19DiffableDataSources0aB14SourceSnapshotC15itemIdentifiersSayq_Gvp"></a>
<a name="/s:19DiffableDataSources0aB14SourceSnapshotV15itemIdentifiersSayq_Gvp"></a>
<a name="//apple_ref/swift/Property/itemIdentifiers" class="dashAnchor"></a>
<a class="token" href="#/s:19DiffableDataSources0aB14SourceSnapshotC15itemIdentifiersSayq_Gvp">itemIdentifiers</a>
<a class="token" href="#/s:19DiffableDataSources0aB14SourceSnapshotV15itemIdentifiersSayq_Gvp">itemIdentifiers</a>
</code>
</div>
<div class="height-container">
@@ -230,9 +230,9 @@ Represents the mutable state of diffable data source of UI.</p>
<li class="item">
<div>
<code>
<a name="/s:19DiffableDataSources0aB14SourceSnapshotC13numberOfItems9inSectionSix_tF"></a>
<a name="/s:19DiffableDataSources0aB14SourceSnapshotV13numberOfItems9inSectionSix_tF"></a>
<a name="//apple_ref/swift/Method/numberOfItems(inSection:)" class="dashAnchor"></a>
<a class="token" href="#/s:19DiffableDataSources0aB14SourceSnapshotC13numberOfItems9inSectionSix_tF">numberOfItems(inSection:)</a>
<a class="token" href="#/s:19DiffableDataSources0aB14SourceSnapshotV13numberOfItems9inSectionSix_tF">numberOfItems(inSection:)</a>
</code>
</div>
<div class="height-container">
@@ -280,9 +280,9 @@ Represents the mutable state of diffable data source of UI.</p>
<li class="item">
<div>
<code>
<a name="/s:19DiffableDataSources0aB14SourceSnapshotC15itemIdentifiers9inSectionSayq_Gx_tF"></a>
<a name="/s:19DiffableDataSources0aB14SourceSnapshotV15itemIdentifiers9inSectionSayq_Gx_tF"></a>
<a name="//apple_ref/swift/Method/itemIdentifiers(inSection:)" class="dashAnchor"></a>
<a class="token" href="#/s:19DiffableDataSources0aB14SourceSnapshotC15itemIdentifiers9inSectionSayq_Gx_tF">itemIdentifiers(inSection:)</a>
<a class="token" href="#/s:19DiffableDataSources0aB14SourceSnapshotV15itemIdentifiers9inSectionSayq_Gx_tF">itemIdentifiers(inSection:)</a>
</code>
</div>
<div class="height-container">
@@ -330,9 +330,9 @@ Represents the mutable state of diffable data source of UI.</p>
<li class="item">
<div>
<code>
<a name="/s:19DiffableDataSources0aB14SourceSnapshotC17sectionIdentifier14containingItemxSgq__tF"></a>
<a name="/s:19DiffableDataSources0aB14SourceSnapshotV17sectionIdentifier14containingItemxSgq__tF"></a>
<a name="//apple_ref/swift/Method/sectionIdentifier(containingItem:)" class="dashAnchor"></a>
<a class="token" href="#/s:19DiffableDataSources0aB14SourceSnapshotC17sectionIdentifier14containingItemxSgq__tF">sectionIdentifier(containingItem:)</a>
<a class="token" href="#/s:19DiffableDataSources0aB14SourceSnapshotV17sectionIdentifier14containingItemxSgq__tF">sectionIdentifier(containingItem:)</a>
</code>
</div>
<div class="height-container">
@@ -380,9 +380,9 @@ Represents the mutable state of diffable data source of UI.</p>
<li class="item">
<div>
<code>
<a name="/s:19DiffableDataSources0aB14SourceSnapshotC11indexOfItemySiSgq_F"></a>
<a name="/s:19DiffableDataSources0aB14SourceSnapshotV11indexOfItemySiSgq_F"></a>
<a name="//apple_ref/swift/Method/indexOfItem(_:)" class="dashAnchor"></a>
<a class="token" href="#/s:19DiffableDataSources0aB14SourceSnapshotC11indexOfItemySiSgq_F">indexOfItem(_:)</a>
<a class="token" href="#/s:19DiffableDataSources0aB14SourceSnapshotV11indexOfItemySiSgq_F">indexOfItem(_:)</a>
</code>
</div>
<div class="height-container">
@@ -430,9 +430,9 @@ Represents the mutable state of diffable data source of UI.</p>
<li class="item">
<div>
<code>
<a name="/s:19DiffableDataSources0aB14SourceSnapshotC14indexOfSectionySiSgxF"></a>
<a name="/s:19DiffableDataSources0aB14SourceSnapshotV14indexOfSectionySiSgxF"></a>
<a name="//apple_ref/swift/Method/indexOfSection(_:)" class="dashAnchor"></a>
<a class="token" href="#/s:19DiffableDataSources0aB14SourceSnapshotC14indexOfSectionySiSgxF">indexOfSection(_:)</a>
<a class="token" href="#/s:19DiffableDataSources0aB14SourceSnapshotV14indexOfSectionySiSgxF">indexOfSection(_:)</a>
</code>
</div>
<div class="height-container">
@@ -480,9 +480,9 @@ Represents the mutable state of diffable data source of UI.</p>
<li class="item">
<div>
<code>
<a name="/s:19DiffableDataSources0aB14SourceSnapshotC11appendItems_9toSectionySayq_G_xSgtF"></a>
<a name="/s:19DiffableDataSources0aB14SourceSnapshotV11appendItems_9toSectionySayq_G_xSgtF"></a>
<a name="//apple_ref/swift/Method/appendItems(_:toSection:)" class="dashAnchor"></a>
<a class="token" href="#/s:19DiffableDataSources0aB14SourceSnapshotC11appendItems_9toSectionySayq_G_xSgtF">appendItems(_:toSection:)</a>
<a class="token" href="#/s:19DiffableDataSources0aB14SourceSnapshotV11appendItems_9toSectionySayq_G_xSgtF">appendItems(_:toSection:)</a>
</code>
</div>
<div class="height-container">
@@ -497,7 +497,7 @@ Represents the mutable state of diffable data source of UI.</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="kd">func</span> <span class="nf">appendItems</span><span class="p">(</span><span class="n">_</span> <span class="nv">identifiers</span><span class="p">:</span> <span class="p">[</span><span class="kt">ItemIdentifierType</span><span class="p">],</span> <span class="n">toSection</span> <span class="nv">sectionIdentifier</span><span class="p">:</span> <span class="kt">SectionIdentifierType</span><span class="p">?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">)</span></code></pre>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">mutating</span> <span class="kd">func</span> <span class="nf">appendItems</span><span class="p">(</span><span class="n">_</span> <span class="nv">identifiers</span><span class="p">:</span> <span class="p">[</span><span class="kt">ItemIdentifierType</span><span class="p">],</span> <span class="n">toSection</span> <span class="nv">sectionIdentifier</span><span class="p">:</span> <span class="kt">SectionIdentifierType</span><span class="p">?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">)</span></code></pre>
</div>
</div>
@@ -538,9 +538,9 @@ Represents the mutable state of diffable data source of UI.</p>
<li class="item">
<div>
<code>
<a name="/s:19DiffableDataSources0aB14SourceSnapshotC11insertItems_10beforeItemySayq_G_q_tF"></a>
<a name="/s:19DiffableDataSources0aB14SourceSnapshotV11insertItems_10beforeItemySayq_G_q_tF"></a>
<a name="//apple_ref/swift/Method/insertItems(_:beforeItem:)" class="dashAnchor"></a>
<a class="token" href="#/s:19DiffableDataSources0aB14SourceSnapshotC11insertItems_10beforeItemySayq_G_q_tF">insertItems(_:beforeItem:)</a>
<a class="token" href="#/s:19DiffableDataSources0aB14SourceSnapshotV11insertItems_10beforeItemySayq_G_q_tF">insertItems(_:beforeItem:)</a>
</code>
</div>
<div class="height-container">
@@ -555,7 +555,7 @@ Represents the mutable state of diffable data source of UI.</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="kd">func</span> <span class="nf">insertItems</span><span class="p">(</span><span class="n">_</span> <span class="nv">identifiers</span><span class="p">:</span> <span class="p">[</span><span class="kt">ItemIdentifierType</span><span class="p">],</span> <span class="n">beforeItem</span> <span class="nv">beforeIdentifier</span><span class="p">:</span> <span class="kt">ItemIdentifierType</span><span class="p">)</span></code></pre>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">mutating</span> <span class="kd">func</span> <span class="nf">insertItems</span><span class="p">(</span><span class="n">_</span> <span class="nv">identifiers</span><span class="p">:</span> <span class="p">[</span><span class="kt">ItemIdentifierType</span><span class="p">],</span> <span class="n">beforeItem</span> <span class="nv">beforeIdentifier</span><span class="p">:</span> <span class="kt">ItemIdentifierType</span><span class="p">)</span></code></pre>
</div>
</div>
@@ -596,9 +596,9 @@ Represents the mutable state of diffable data source of UI.</p>
<li class="item">
<div>
<code>
<a name="/s:19DiffableDataSources0aB14SourceSnapshotC11insertItems_9afterItemySayq_G_q_tF"></a>
<a name="/s:19DiffableDataSources0aB14SourceSnapshotV11insertItems_9afterItemySayq_G_q_tF"></a>
<a name="//apple_ref/swift/Method/insertItems(_:afterItem:)" class="dashAnchor"></a>
<a class="token" href="#/s:19DiffableDataSources0aB14SourceSnapshotC11insertItems_9afterItemySayq_G_q_tF">insertItems(_:afterItem:)</a>
<a class="token" href="#/s:19DiffableDataSources0aB14SourceSnapshotV11insertItems_9afterItemySayq_G_q_tF">insertItems(_:afterItem:)</a>
</code>
</div>
<div class="height-container">
@@ -613,7 +613,7 @@ Represents the mutable state of diffable data source of UI.</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="kd">func</span> <span class="nf">insertItems</span><span class="p">(</span><span class="n">_</span> <span class="nv">identifiers</span><span class="p">:</span> <span class="p">[</span><span class="kt">ItemIdentifierType</span><span class="p">],</span> <span class="n">afterItem</span> <span class="nv">afterIdentifier</span><span class="p">:</span> <span class="kt">ItemIdentifierType</span><span class="p">)</span></code></pre>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">mutating</span> <span class="kd">func</span> <span class="nf">insertItems</span><span class="p">(</span><span class="n">_</span> <span class="nv">identifiers</span><span class="p">:</span> <span class="p">[</span><span class="kt">ItemIdentifierType</span><span class="p">],</span> <span class="n">afterItem</span> <span class="nv">afterIdentifier</span><span class="p">:</span> <span class="kt">ItemIdentifierType</span><span class="p">)</span></code></pre>
</div>
</div>
@@ -654,9 +654,9 @@ Represents the mutable state of diffable data source of UI.</p>
<li class="item">
<div>
<code>
<a name="/s:19DiffableDataSources0aB14SourceSnapshotC11deleteItemsyySayq_GF"></a>
<a name="/s:19DiffableDataSources0aB14SourceSnapshotV11deleteItemsyySayq_GF"></a>
<a name="//apple_ref/swift/Method/deleteItems(_:)" class="dashAnchor"></a>
<a class="token" href="#/s:19DiffableDataSources0aB14SourceSnapshotC11deleteItemsyySayq_GF">deleteItems(_:)</a>
<a class="token" href="#/s:19DiffableDataSources0aB14SourceSnapshotV11deleteItemsyySayq_GF">deleteItems(_:)</a>
</code>
</div>
<div class="height-container">
@@ -671,7 +671,7 @@ Represents the mutable state of diffable data source of UI.</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="kd">func</span> <span class="nf">deleteItems</span><span class="p">(</span><span class="n">_</span> <span class="nv">identifiers</span><span class="p">:</span> <span class="p">[</span><span class="kt">ItemIdentifierType</span><span class="p">])</span></code></pre>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">mutating</span> <span class="kd">func</span> <span class="nf">deleteItems</span><span class="p">(</span><span class="n">_</span> <span class="nv">identifiers</span><span class="p">:</span> <span class="p">[</span><span class="kt">ItemIdentifierType</span><span class="p">])</span></code></pre>
</div>
</div>
@@ -700,9 +700,9 @@ Represents the mutable state of diffable data source of UI.</p>
<li class="item">
<div>
<code>
<a name="/s:19DiffableDataSources0aB14SourceSnapshotC14deleteAllItemsyyF"></a>
<a name="/s:19DiffableDataSources0aB14SourceSnapshotV14deleteAllItemsyyF"></a>
<a name="//apple_ref/swift/Method/deleteAllItems()" class="dashAnchor"></a>
<a class="token" href="#/s:19DiffableDataSources0aB14SourceSnapshotC14deleteAllItemsyyF">deleteAllItems()</a>
<a class="token" href="#/s:19DiffableDataSources0aB14SourceSnapshotV14deleteAllItemsyyF">deleteAllItems()</a>
</code>
</div>
<div class="height-container">
@@ -717,7 +717,7 @@ Represents the mutable state of diffable data source of UI.</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="kd">func</span> <span class="nf">deleteAllItems</span><span class="p">()</span></code></pre>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">mutating</span> <span class="kd">func</span> <span class="nf">deleteAllItems</span><span class="p">()</span></code></pre>
</div>
</div>
@@ -727,9 +727,9 @@ Represents the mutable state of diffable data source of UI.</p>
<li class="item">
<div>
<code>
<a name="/s:19DiffableDataSources0aB14SourceSnapshotC8moveItem_06beforeG0yq__q_tF"></a>
<a name="/s:19DiffableDataSources0aB14SourceSnapshotV8moveItem_06beforeG0yq__q_tF"></a>
<a name="//apple_ref/swift/Method/moveItem(_:beforeItem:)" class="dashAnchor"></a>
<a class="token" href="#/s:19DiffableDataSources0aB14SourceSnapshotC8moveItem_06beforeG0yq__q_tF">moveItem(_:beforeItem:)</a>
<a class="token" href="#/s:19DiffableDataSources0aB14SourceSnapshotV8moveItem_06beforeG0yq__q_tF">moveItem(_:beforeItem:)</a>
</code>
</div>
<div class="height-container">
@@ -744,7 +744,7 @@ Represents the mutable state of diffable data source of UI.</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="kd">func</span> <span class="nf">moveItem</span><span class="p">(</span><span class="n">_</span> <span class="nv">identifier</span><span class="p">:</span> <span class="kt">ItemIdentifierType</span><span class="p">,</span> <span class="n">beforeItem</span> <span class="nv">toIdentifier</span><span class="p">:</span> <span class="kt">ItemIdentifierType</span><span class="p">)</span></code></pre>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">mutating</span> <span class="kd">func</span> <span class="nf">moveItem</span><span class="p">(</span><span class="n">_</span> <span class="nv">identifier</span><span class="p">:</span> <span class="kt">ItemIdentifierType</span><span class="p">,</span> <span class="n">beforeItem</span> <span class="nv">toIdentifier</span><span class="p">:</span> <span class="kt">ItemIdentifierType</span><span class="p">)</span></code></pre>
</div>
</div>
@@ -785,9 +785,9 @@ Represents the mutable state of diffable data source of UI.</p>
<li class="item">
<div>
<code>
<a name="/s:19DiffableDataSources0aB14SourceSnapshotC8moveItem_05afterG0yq__q_tF"></a>
<a name="/s:19DiffableDataSources0aB14SourceSnapshotV8moveItem_05afterG0yq__q_tF"></a>
<a name="//apple_ref/swift/Method/moveItem(_:afterItem:)" class="dashAnchor"></a>
<a class="token" href="#/s:19DiffableDataSources0aB14SourceSnapshotC8moveItem_05afterG0yq__q_tF">moveItem(_:afterItem:)</a>
<a class="token" href="#/s:19DiffableDataSources0aB14SourceSnapshotV8moveItem_05afterG0yq__q_tF">moveItem(_:afterItem:)</a>
</code>
</div>
<div class="height-container">
@@ -802,7 +802,7 @@ Represents the mutable state of diffable data source of UI.</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="kd">func</span> <span class="nf">moveItem</span><span class="p">(</span><span class="n">_</span> <span class="nv">identifier</span><span class="p">:</span> <span class="kt">ItemIdentifierType</span><span class="p">,</span> <span class="n">afterItem</span> <span class="nv">toIdentifier</span><span class="p">:</span> <span class="kt">ItemIdentifierType</span><span class="p">)</span></code></pre>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">mutating</span> <span class="kd">func</span> <span class="nf">moveItem</span><span class="p">(</span><span class="n">_</span> <span class="nv">identifier</span><span class="p">:</span> <span class="kt">ItemIdentifierType</span><span class="p">,</span> <span class="n">afterItem</span> <span class="nv">toIdentifier</span><span class="p">:</span> <span class="kt">ItemIdentifierType</span><span class="p">)</span></code></pre>
</div>
</div>
@@ -843,9 +843,9 @@ Represents the mutable state of diffable data source of UI.</p>
<li class="item">
<div>
<code>
<a name="/s:19DiffableDataSources0aB14SourceSnapshotC11reloadItemsyySayq_GF"></a>
<a name="/s:19DiffableDataSources0aB14SourceSnapshotV11reloadItemsyySayq_GF"></a>
<a name="//apple_ref/swift/Method/reloadItems(_:)" class="dashAnchor"></a>
<a class="token" href="#/s:19DiffableDataSources0aB14SourceSnapshotC11reloadItemsyySayq_GF">reloadItems(_:)</a>
<a class="token" href="#/s:19DiffableDataSources0aB14SourceSnapshotV11reloadItemsyySayq_GF">reloadItems(_:)</a>
</code>
</div>
<div class="height-container">
@@ -860,7 +860,7 @@ Represents the mutable state of diffable data source of UI.</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="kd">func</span> <span class="nf">reloadItems</span><span class="p">(</span><span class="n">_</span> <span class="nv">identifiers</span><span class="p">:</span> <span class="p">[</span><span class="kt">ItemIdentifierType</span><span class="p">])</span></code></pre>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">mutating</span> <span class="kd">func</span> <span class="nf">reloadItems</span><span class="p">(</span><span class="n">_</span> <span class="nv">identifiers</span><span class="p">:</span> <span class="p">[</span><span class="kt">ItemIdentifierType</span><span class="p">])</span></code></pre>
</div>
</div>
@@ -889,9 +889,9 @@ Represents the mutable state of diffable data source of UI.</p>
<li class="item">
<div>
<code>
<a name="/s:19DiffableDataSources0aB14SourceSnapshotC14appendSectionsyySayxGF"></a>
<a name="/s:19DiffableDataSources0aB14SourceSnapshotV14appendSectionsyySayxGF"></a>
<a name="//apple_ref/swift/Method/appendSections(_:)" class="dashAnchor"></a>
<a class="token" href="#/s:19DiffableDataSources0aB14SourceSnapshotC14appendSectionsyySayxGF">appendSections(_:)</a>
<a class="token" href="#/s:19DiffableDataSources0aB14SourceSnapshotV14appendSectionsyySayxGF">appendSections(_:)</a>
</code>
</div>
<div class="height-container">
@@ -906,7 +906,7 @@ Represents the mutable state of diffable data source of UI.</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="kd">func</span> <span class="nf">appendSections</span><span class="p">(</span><span class="n">_</span> <span class="nv">identifiers</span><span class="p">:</span> <span class="p">[</span><span class="kt">SectionIdentifierType</span><span class="p">])</span></code></pre>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">mutating</span> <span class="kd">func</span> <span class="nf">appendSections</span><span class="p">(</span><span class="n">_</span> <span class="nv">identifiers</span><span class="p">:</span> <span class="p">[</span><span class="kt">SectionIdentifierType</span><span class="p">])</span></code></pre>
</div>
</div>
@@ -935,9 +935,9 @@ Represents the mutable state of diffable data source of UI.</p>
<li class="item">
<div>
<code>
<a name="/s:19DiffableDataSources0aB14SourceSnapshotC14insertSections_13beforeSectionySayxG_xtF"></a>
<a name="/s:19DiffableDataSources0aB14SourceSnapshotV14insertSections_13beforeSectionySayxG_xtF"></a>
<a name="//apple_ref/swift/Method/insertSections(_:beforeSection:)" class="dashAnchor"></a>
<a class="token" href="#/s:19DiffableDataSources0aB14SourceSnapshotC14insertSections_13beforeSectionySayxG_xtF">insertSections(_:beforeSection:)</a>
<a class="token" href="#/s:19DiffableDataSources0aB14SourceSnapshotV14insertSections_13beforeSectionySayxG_xtF">insertSections(_:beforeSection:)</a>
</code>
</div>
<div class="height-container">
@@ -952,7 +952,7 @@ Represents the mutable state of diffable data source of UI.</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="kd">func</span> <span class="nf">insertSections</span><span class="p">(</span><span class="n">_</span> <span class="nv">identifiers</span><span class="p">:</span> <span class="p">[</span><span class="kt">SectionIdentifierType</span><span class="p">],</span> <span class="n">beforeSection</span> <span class="nv">toIdentifier</span><span class="p">:</span> <span class="kt">SectionIdentifierType</span><span class="p">)</span></code></pre>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">mutating</span> <span class="kd">func</span> <span class="nf">insertSections</span><span class="p">(</span><span class="n">_</span> <span class="nv">identifiers</span><span class="p">:</span> <span class="p">[</span><span class="kt">SectionIdentifierType</span><span class="p">],</span> <span class="n">beforeSection</span> <span class="nv">toIdentifier</span><span class="p">:</span> <span class="kt">SectionIdentifierType</span><span class="p">)</span></code></pre>
</div>
</div>
@@ -993,9 +993,9 @@ Represents the mutable state of diffable data source of UI.</p>
<li class="item">
<div>
<code>
<a name="/s:19DiffableDataSources0aB14SourceSnapshotC14insertSections_12afterSectionySayxG_xtF"></a>
<a name="/s:19DiffableDataSources0aB14SourceSnapshotV14insertSections_12afterSectionySayxG_xtF"></a>
<a name="//apple_ref/swift/Method/insertSections(_:afterSection:)" class="dashAnchor"></a>
<a class="token" href="#/s:19DiffableDataSources0aB14SourceSnapshotC14insertSections_12afterSectionySayxG_xtF">insertSections(_:afterSection:)</a>
<a class="token" href="#/s:19DiffableDataSources0aB14SourceSnapshotV14insertSections_12afterSectionySayxG_xtF">insertSections(_:afterSection:)</a>
</code>
</div>
<div class="height-container">
@@ -1010,7 +1010,7 @@ Represents the mutable state of diffable data source of UI.</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="kd">func</span> <span class="nf">insertSections</span><span class="p">(</span><span class="n">_</span> <span class="nv">identifiers</span><span class="p">:</span> <span class="p">[</span><span class="kt">SectionIdentifierType</span><span class="p">],</span> <span class="n">afterSection</span> <span class="nv">toIdentifier</span><span class="p">:</span> <span class="kt">SectionIdentifierType</span><span class="p">)</span></code></pre>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">mutating</span> <span class="kd">func</span> <span class="nf">insertSections</span><span class="p">(</span><span class="n">_</span> <span class="nv">identifiers</span><span class="p">:</span> <span class="p">[</span><span class="kt">SectionIdentifierType</span><span class="p">],</span> <span class="n">afterSection</span> <span class="nv">toIdentifier</span><span class="p">:</span> <span class="kt">SectionIdentifierType</span><span class="p">)</span></code></pre>
</div>
</div>
@@ -1051,9 +1051,9 @@ Represents the mutable state of diffable data source of UI.</p>
<li class="item">
<div>
<code>
<a name="/s:19DiffableDataSources0aB14SourceSnapshotC14deleteSectionsyySayxGF"></a>
<a name="/s:19DiffableDataSources0aB14SourceSnapshotV14deleteSectionsyySayxGF"></a>
<a name="//apple_ref/swift/Method/deleteSections(_:)" class="dashAnchor"></a>
<a class="token" href="#/s:19DiffableDataSources0aB14SourceSnapshotC14deleteSectionsyySayxGF">deleteSections(_:)</a>
<a class="token" href="#/s:19DiffableDataSources0aB14SourceSnapshotV14deleteSectionsyySayxGF">deleteSections(_:)</a>
</code>
</div>
<div class="height-container">
@@ -1068,7 +1068,7 @@ Represents the mutable state of diffable data source of UI.</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="kd">func</span> <span class="nf">deleteSections</span><span class="p">(</span><span class="n">_</span> <span class="nv">identifiers</span><span class="p">:</span> <span class="p">[</span><span class="kt">SectionIdentifierType</span><span class="p">])</span></code></pre>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">mutating</span> <span class="kd">func</span> <span class="nf">deleteSections</span><span class="p">(</span><span class="n">_</span> <span class="nv">identifiers</span><span class="p">:</span> <span class="p">[</span><span class="kt">SectionIdentifierType</span><span class="p">])</span></code></pre>
</div>
</div>
@@ -1097,9 +1097,9 @@ Represents the mutable state of diffable data source of UI.</p>
<li class="item">
<div>
<code>
<a name="/s:19DiffableDataSources0aB14SourceSnapshotC11moveSection_06beforeG0yx_xtF"></a>
<a name="/s:19DiffableDataSources0aB14SourceSnapshotV11moveSection_06beforeG0yx_xtF"></a>
<a name="//apple_ref/swift/Method/moveSection(_:beforeSection:)" class="dashAnchor"></a>
<a class="token" href="#/s:19DiffableDataSources0aB14SourceSnapshotC11moveSection_06beforeG0yx_xtF">moveSection(_:beforeSection:)</a>
<a class="token" href="#/s:19DiffableDataSources0aB14SourceSnapshotV11moveSection_06beforeG0yx_xtF">moveSection(_:beforeSection:)</a>
</code>
</div>
<div class="height-container">
@@ -1114,7 +1114,7 @@ Represents the mutable state of diffable data source of UI.</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="kd">func</span> <span class="nf">moveSection</span><span class="p">(</span><span class="n">_</span> <span class="nv">identifier</span><span class="p">:</span> <span class="kt">SectionIdentifierType</span><span class="p">,</span> <span class="n">beforeSection</span> <span class="nv">toIdentifier</span><span class="p">:</span> <span class="kt">SectionIdentifierType</span><span class="p">)</span></code></pre>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">mutating</span> <span class="kd">func</span> <span class="nf">moveSection</span><span class="p">(</span><span class="n">_</span> <span class="nv">identifier</span><span class="p">:</span> <span class="kt">SectionIdentifierType</span><span class="p">,</span> <span class="n">beforeSection</span> <span class="nv">toIdentifier</span><span class="p">:</span> <span class="kt">SectionIdentifierType</span><span class="p">)</span></code></pre>
</div>
</div>
@@ -1155,9 +1155,9 @@ Represents the mutable state of diffable data source of UI.</p>
<li class="item">
<div>
<code>
<a name="/s:19DiffableDataSources0aB14SourceSnapshotC11moveSection_05afterG0yx_xtF"></a>
<a name="/s:19DiffableDataSources0aB14SourceSnapshotV11moveSection_05afterG0yx_xtF"></a>
<a name="//apple_ref/swift/Method/moveSection(_:afterSection:)" class="dashAnchor"></a>
<a class="token" href="#/s:19DiffableDataSources0aB14SourceSnapshotC11moveSection_05afterG0yx_xtF">moveSection(_:afterSection:)</a>
<a class="token" href="#/s:19DiffableDataSources0aB14SourceSnapshotV11moveSection_05afterG0yx_xtF">moveSection(_:afterSection:)</a>
</code>
</div>
<div class="height-container">
@@ -1172,7 +1172,7 @@ Represents the mutable state of diffable data source of UI.</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="kd">func</span> <span class="nf">moveSection</span><span class="p">(</span><span class="n">_</span> <span class="nv">identifier</span><span class="p">:</span> <span class="kt">SectionIdentifierType</span><span class="p">,</span> <span class="n">afterSection</span> <span class="nv">toIdentifier</span><span class="p">:</span> <span class="kt">SectionIdentifierType</span><span class="p">)</span></code></pre>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">mutating</span> <span class="kd">func</span> <span class="nf">moveSection</span><span class="p">(</span><span class="n">_</span> <span class="nv">identifier</span><span class="p">:</span> <span class="kt">SectionIdentifierType</span><span class="p">,</span> <span class="n">afterSection</span> <span class="nv">toIdentifier</span><span class="p">:</span> <span class="kt">SectionIdentifierType</span><span class="p">)</span></code></pre>
</div>
</div>
@@ -1213,9 +1213,9 @@ Represents the mutable state of diffable data source of UI.</p>
<li class="item">
<div>
<code>
<a name="/s:19DiffableDataSources0aB14SourceSnapshotC14reloadSectionsyySayxGF"></a>
<a name="/s:19DiffableDataSources0aB14SourceSnapshotV14reloadSectionsyySayxGF"></a>
<a name="//apple_ref/swift/Method/reloadSections(_:)" class="dashAnchor"></a>
<a class="token" href="#/s:19DiffableDataSources0aB14SourceSnapshotC14reloadSectionsyySayxGF">reloadSections(_:)</a>
<a class="token" href="#/s:19DiffableDataSources0aB14SourceSnapshotV14reloadSectionsyySayxGF">reloadSections(_:)</a>
</code>
</div>
<div class="height-container">
@@ -1230,7 +1230,7 @@ Represents the mutable state of diffable data source of UI.</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="kd">func</span> <span class="nf">reloadSections</span><span class="p">(</span><span class="n">_</span> <span class="nv">identifiers</span><span class="p">:</span> <span class="p">[</span><span class="kt">SectionIdentifierType</span><span class="p">])</span></code></pre>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">mutating</span> <span class="kd">func</span> <span class="nf">reloadSections</span><span class="p">(</span><span class="n">_</span> <span class="nv">identifiers</span><span class="p">:</span> <span class="p">[</span><span class="kt">SectionIdentifierType</span><span class="p">])</span></code></pre>
</div>
</div>
@@ -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-06-24)</p>
<p>&copy; 2019 <a class="link" href="https://github.com/ra1028" target="_blank" rel="external">Ryo Aoyama</a>. All rights reserved. (Last updated: 2019-09-02)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.4</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</body>
+3 -3
View File
@@ -64,7 +64,7 @@
<a class="nav-group-name-link" href="Snapshot.html">Snapshot</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/DiffableDataSourceSnapshot.html">DiffableDataSourceSnapshot</a>
<a class="nav-group-task-link" href="Structs/DiffableDataSourceSnapshot.html">DiffableDataSourceSnapshot</a>
</li>
</ul>
</li>
@@ -207,7 +207,7 @@ You should dequeue the non nil cells via closure. </p>
<span class="p">}</span>
</code></pre>
<p>Manages and updates the data sources intuitively by intermediating <code><a href="Classes/DiffableDataSourceSnapshot.html">DiffableDataSourceSnapshot</a></code>.<br>
<p>Manages and updates the data sources intuitively by intermediating <code><a href="Structs/DiffableDataSourceSnapshot.html">DiffableDataSourceSnapshot</a></code>.<br>
The UI isn&rsquo;t updated until you apply the edited snapshot object.<br>
Update the UI with diffing animation automatically calculated by applying an edited snapshot. </p>
<pre class="highlight swift"><code><span class="k">let</span> <span class="nv">users</span> <span class="o">=</span> <span class="p">[</span>
@@ -285,7 +285,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-06-24)</p>
<p>&copy; 2019 <a class="link" href="https://github.com/ra1028" target="_blank" rel="external">Ryo Aoyama</a>. All rights reserved. (Last updated: 2019-09-02)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.4</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