Skip to content

Commit 341399f

Browse files
committed
Update example. Update readmy. Update pod version.
1 parent f1a672d commit 341399f

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

Example/Controllers/RootController.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ class RootController: DiffableTableController {
124124
didSet {
125125
print("Stepper value is: \(stepperValue)")
126126
updateContent(animating: true)
127-
/*guard let indexPath = diffableDataSource?.indexPath(for: SPDiffableItem(identifier: stepperValueIdentifier)), let cell = tableView.cellForRow(at: indexPath) else { return }
128-
cell.detailTextLabel?.text = "\(Int(stepperValue))"*/
127+
guard let indexPath = diffableDataSource?.indexPath(for: stepperValueIdentifier), let cell = tableView.cellForRow(at: indexPath) else { return }
128+
cell.detailTextLabel?.text = "\(Int(stepperValue))"
129129
}
130130
}
131131

Readme.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ If you want help project, check [Сooperation](#сooperation) section.
2323
- [Sidebar](#sidebar)
2424
- [Ready Use](#ready-use)
2525
- [Example](#ready-use)
26-
- [Ready-use models](#ready-use-models)
26+
- [List classes](#ready-use-classes)
2727
- [Сooperation](#сooperation)
2828
- [Other Projects](#other-projects)
2929
- [Russian Community](#russian-community)
@@ -66,7 +66,7 @@ If you prefer not to use any of dependency managers, you can integrate `SPDiffab
6666

6767
## Usage
6868

69-
Before read it, highly recomded check `Example` target in project. It examle show all features, like use stepper and switch, like process actions, create custom models and many other. Also you can skip full undestand logic and read [Ready-use section](#Ready Use) with minimum of code for start.
69+
Before read it, highly recomded check `Example` target in project. It examle show all features, like use stepper and switch, like process actions, create custom models and many other. Also you can skip full undestand logic and read [Ready-use section](https://github.com/ivanvorobei/SPDiffable#ready-use) with minimum of code for start.
7070

7171
For work with diffable need create model (inside project you found some ready-use models) and do cell provider, which convert data-model to `UITableViewCell` or `UICollectionViewCell`. Next example for table, but all methods and class names available for collections.
7272

@@ -227,18 +227,21 @@ let section = SPDiffableSection(
227227

228228
You init cell model and pass action, choose selection style and other. As you see, model describe native table cell. Next, you need set cell provider, but it also already available, for get it call `SPDiffableTableController.defaultCellProvider`.
229229

230-
```
230+
```swift
231231
setCellProviders([SPDiffableTableController.defaultCellProvider], sections: [section])
232232
```
233233

234234
Now project's models automatically converting to cell. No need any additional work. That all code.
235235

236236
For update table shoud using `apply()` method:
237-
```
237+
238+
```swift
238239
diffableDataSource?.apply(sections: [section], animating: true)
239240
```
240241

241-
## Ready-use models
242+
If you use custom table view or table controller, don't forget register cells classes. For `SPDiffableTableController` all cells already registered.
243+
244+
## Ready-use classes
242245

243246
It models which you can use now, it shoud close your task without code. Of couse you can create your models.
244247
Now in project you can find this ready-use models:

SPDiffable.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Pod::Spec.new do |s|
22

33
s.name = "SPDiffable"
4-
s.version = "1.0.5"
4+
s.version = "1.1"
55
s.summary = "Extenshion of Diffable API which allow not duplicate code and use less models."
66
s.homepage = "https://github.com/IvanVorobei/SPDiffable"
77
s.source = { :git => "https://github.com/IvanVorobei/SPDiffable.git", :tag => s.version }

0 commit comments

Comments
 (0)