mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-01-15 13:43:43 +01:00
small correction to documentation
While using some code from the documentation that led to issues I noticed that some parts of it are not accurate anymore, so I corrected a few small things that came to my attention. Maybe it is worth having an even closer look though.
This commit is contained in:
12
README.md
12
README.md
@@ -1513,10 +1513,10 @@ Including `ListObserver`, there are 3 observer protocols you can implement depen
|
||||
|
||||
- `ListObjectObserver`: in addition to `ListObserver` methods, also lets you handle object inserts, updates, and deletes:
|
||||
```swift
|
||||
func listMonitor(_ monitor: ListMonitor<MyPersonEntity>, didInsertObject object: MyPersonEntity, toIndexPath indexPath: NSIndexPath)
|
||||
func listMonitor(_ monitor: ListMonitor<MyPersonEntity>, didDeleteObject object: MyPersonEntity, fromIndexPath indexPath: NSIndexPath)
|
||||
func listMonitor(_ monitor: ListMonitor<MyPersonEntity>, didUpdateObject object: MyPersonEntity, atIndexPath indexPath: NSIndexPath)
|
||||
func listMonitor(_ monitor: ListMonitor<MyPersonEntity>, didMoveObject object: MyPersonEntity, fromIndexPath: NSIndexPath, toIndexPath: NSIndexPath)
|
||||
func listMonitor(_ monitor: ListMonitor<MyPersonEntity>, didInsertObject object: MyPersonEntity, toIndexPath indexPath: IndexPath)
|
||||
func listMonitor(_ monitor: ListMonitor<MyPersonEntity>, didDeleteObject object: MyPersonEntity, fromIndexPath indexPath: IndexPath)
|
||||
func listMonitor(_ monitor: ListMonitor<MyPersonEntity>, didUpdateObject object: MyPersonEntity, atIndexPath indexPath: IndexPath)
|
||||
func listMonitor(_ monitor: ListMonitor<MyPersonEntity>, didMoveObject object: MyPersonEntity, fromIndexPath: IndexPath, toIndexPath: IndexPath)
|
||||
```
|
||||
- `ListSectionObserver`: in addition to `ListObjectObserver` methods, also lets you handle section inserts and deletes:
|
||||
```swift
|
||||
@@ -1573,9 +1573,9 @@ func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -
|
||||
}
|
||||
```
|
||||
|
||||
To access the objects of a sectioned list, use an `NSIndexPath` or a tuple:
|
||||
To access the objects of a sectioned list, use an `IndexPath` or a tuple:
|
||||
```swift
|
||||
let indexPath = NSIndexPath(forRow: 2, inSection: 1)
|
||||
let indexPath = IndexPath(row: 2, section: 1)
|
||||
let person1 = self.monitor[indexPath]
|
||||
let person2 = self.monitor[1, 2]
|
||||
// person1 and person2 are the same object
|
||||
|
||||
Reference in New Issue
Block a user