forked from 3lvis/DATASource
-
Notifications
You must be signed in to change notification settings - Fork 0
/
DATASourceDelegate.swift
63 lines (52 loc) · 3.14 KB
/
DATASourceDelegate.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import UIKit
import CoreData
@objc public protocol DATASourceDelegate: NSObjectProtocol {
/*!
* **************************
*
* Cell Configuration
*
* **************************
*/
@objc optional func dataSource(_ dataSource: DATASource, cellIdentifierFor indexPath: IndexPath) -> String
@objc optional func dataSource(_ dataSource: DATASource, configureTableViewCell cell: UITableViewCell, withItem item: NSManagedObject, atIndexPath indexPath: IndexPath)
@objc optional func dataSource(_ dataSource: DATASource, configureCollectionViewCell cell: UICollectionViewCell, withItem item: NSManagedObject, atIndexPath indexPath: IndexPath)
/*!
* **************************
*
* NSFetchedResultsControllerDelegate
*
* **************************
*/
@objc optional func dataSource(_ dataSource: DATASource, didInsertObject object: NSManagedObject, atIndexPath indexPath: IndexPath)
@objc optional func dataSource(_ dataSource: DATASource, didUpdateObject object: NSManagedObject, atIndexPath indexPath: IndexPath)
@objc optional func dataSource(_ dataSource: DATASource, didDeleteObject object: NSManagedObject, atIndexPath indexPath: IndexPath)
@objc optional func dataSource(_ dataSource: DATASource, didMoveObject object: NSManagedObject, fromIndexPath oldIndexPath: IndexPath, toIndexPath newIndexPath: IndexPath)
@objc optional func dataSourceDidChangeContent(_ dataSource: DATASource)
/*!
* **************************
*
* UITableView
*
* **************************
*/
// Sections and Headers
@objc optional func sectionIndexTitlesForDataSource(_ dataSource: DATASource, tableView: UITableView) -> [String]
@objc optional func dataSource(_ dataSource: DATASource, tableView: UITableView, sectionForSectionIndexTitle title: String, atIndex index: Int) -> Int
@objc optional func dataSource(_ dataSource: DATASource, tableView: UITableView, titleForHeaderInSection section: Int) -> String?
@objc optional func dataSource(_ dataSource: DATASource, tableView: UITableView, titleForFooterInSection section: Int) -> String?
// Editing
@objc optional func dataSource(_ dataSource: DATASource, tableView: UITableView, canEditRowAtIndexPath indexPath: IndexPath) -> Bool
@objc optional func dataSource(_ dataSource: DATASource, tableView: UITableView, commitEditingStyle editingStyle: UITableViewCellEditingStyle, forRowAtIndexPath indexPath: IndexPath)
// Moving or Reordering
@objc optional func dataSource(_ dataSource: DATASource, tableView: UITableView, canMoveRowAtIndexPath indexPath: IndexPath) -> Bool
@objc optional func dataSource(_ dataSource: DATASource, tableView: UITableView, moveRowAtIndexPath sourceIndexPath: IndexPath, toIndexPath destinationIndexPath: IndexPath)
/*!
* **************************
*
* UICollectionView
*
* **************************
*/
@objc optional func dataSource(_ dataSource: DATASource, collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, atIndexPath indexPath: IndexPath, withTitle title: Any?) -> UICollectionReusableView?
}