From 56d9719984e92ca9f9587a70c4fd19868086f0ca Mon Sep 17 00:00:00 2001 From: Tim Fraedrich <32460316+timfraedrich@users.noreply.github.com> Date: Fri, 4 Oct 2019 14:19:14 +0000 Subject: [PATCH] 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. --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 327dff0..1a348c4 100644 --- a/README.md +++ b/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, didInsertObject object: MyPersonEntity, toIndexPath indexPath: NSIndexPath) - func listMonitor(_ monitor: ListMonitor, didDeleteObject object: MyPersonEntity, fromIndexPath indexPath: NSIndexPath) - func listMonitor(_ monitor: ListMonitor, didUpdateObject object: MyPersonEntity, atIndexPath indexPath: NSIndexPath) - func listMonitor(_ monitor: ListMonitor, didMoveObject object: MyPersonEntity, fromIndexPath: NSIndexPath, toIndexPath: NSIndexPath) + func listMonitor(_ monitor: ListMonitor, didInsertObject object: MyPersonEntity, toIndexPath indexPath: IndexPath) + func listMonitor(_ monitor: ListMonitor, didDeleteObject object: MyPersonEntity, fromIndexPath indexPath: IndexPath) + func listMonitor(_ monitor: ListMonitor, didUpdateObject object: MyPersonEntity, atIndexPath indexPath: IndexPath) + func listMonitor(_ monitor: ListMonitor, 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