Skip to content

Commit 38ec249

Browse files
committed
source code changes + typos
1 parent 7044aa9 commit 38ec249

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,18 +54,19 @@ These types can be used like that:
5454

5555
```swift
5656
class ViewController: FHDiffableTableViewController<Section, Item> {
57-
override viewDidLoad() {
57+
58+
override func viewDidLoad() {
5859
super.viewDidLoad()
5960

6061
applySnapshot([
61-
FHDiffableDataSourceSnapshotSection(
62+
FHSection(
6263
sectionIdentifier: .main,
6364
itemIdentifiers: [
6465
Item(title: "First Item"),
6566
Item(title: "Second Item")
6667
]
6768
),
68-
FHDiffableDataSourceSnapshotSection(
69+
FHSection(
6970
sectionIdentifier: .detail,
7071
itemIdentifiers: [
7172
Item(title: "Third Item")
@@ -90,7 +91,7 @@ override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: Inde
9091

9192
### Customize Cells
9293

93-
In order to use custom cells, the `cellProvider` property must be overritten. This works exactly the same for table view and collection view.
94+
In order to use custom cells, the `cellProvider` property must be overwritten. This works exactly the same for table view and collection view.
9495

9596
```swift
9697
override var cellProvider: UITableViewDiffableDataSource<Section, Item>.CellProvider {
@@ -102,15 +103,15 @@ override var cellProvider: UITableViewDiffableDataSource<Section, Item>.CellProv
102103
}
103104
```
104105

105-
Do not forget to register the cell bevor you call `applySnapshot(_:)` the first time!
106+
Do not forget to register the cell before you call `applySnapshot(_:)` the first time!
106107

107108
```swift
108109
tableView.register(CustomCell.self, forCellReuseIdentifier: "customCell")
109110
```
110111

111112
### Customize Header and Footer Views (only collection view)
112113

113-
In order to use custom header or footer views, the `supplementaryViewProvider` property must be overritten.
114+
In order to use custom header or footer views, the `supplementaryViewProvider` property must be overwritten.
114115

115116
```swift
116117
override var supplementaryViewProvider: UICollectionViewDiffableDataSource<Section, Item>.SupplementaryViewProvider? {
@@ -127,7 +128,7 @@ override var supplementaryViewProvider: UICollectionViewDiffableDataSource<Secti
127128
}
128129
```
129130

130-
Do not forget to register the cell bevor you call `applySnapshot(_:)` the first time!
131+
Do not forget to register the cell before you call `applySnapshot(_:)` the first time!
131132

132133
```swift
133134
collectionView.register(CustomHeader.self, forSupplementaryViewOfKind: UICollectionView.elementKindSectionHeader, withReuseIdentifier: "customHeader")
@@ -139,6 +140,7 @@ In case you want to change the behavior of the title creation or you want to use
139140

140141
```swift
141142
class CustomDataSource: UITableViewDiffableDataSource<Section, Item> {
143+
142144
override func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
143145
switch snapshot().sectionIdentifiers[section] {
144146
case .main:

0 commit comments

Comments
 (0)