File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ open class SPTableDiffableDataSource: UITableViewDiffableDataSource<SPDiffableSe
4747 }
4848
4949 public override func tableView( _ tableView: UITableView , titleForHeaderInSection section: Int ) -> String ? {
50- if let title = diffableDelegate? . tableView ( tableView, titleForHeaderInSection: section) {
50+ if let title = diffableDelegate? . tableView ? ( tableView, titleForHeaderInSection: section) {
5151 return title
5252 }
5353 if let header = snapshot ( ) . sectionIdentifiers [ section] . header as? SPDiffableTextHeader {
@@ -57,7 +57,7 @@ open class SPTableDiffableDataSource: UITableViewDiffableDataSource<SPDiffableSe
5757 }
5858
5959 public override func tableView( _ tableView: UITableView , titleForFooterInSection section: Int ) -> String ? {
60- if let title = diffableDelegate? . tableView ( tableView, titleForFooterInSection: section) {
60+ if let title = diffableDelegate? . tableView ? ( tableView, titleForFooterInSection: section) {
6161 return title
6262 }
6363 if let footer = snapshot ( ) . sectionIdentifiers [ section] . footer as? SPDiffableTextFooter {
@@ -67,7 +67,7 @@ open class SPTableDiffableDataSource: UITableViewDiffableDataSource<SPDiffableSe
6767 }
6868
6969 public override func tableView( _ tableView: UITableView , canEditRowAt indexPath: IndexPath ) -> Bool {
70- return diffableDelegate? . tableView ( tableView, canEditRowAt: indexPath) ?? false
70+ return diffableDelegate? . tableView ? ( tableView, canEditRowAt: indexPath) ?? false
7171 }
7272}
7373
Original file line number Diff line number Diff line change 2121
2222import UIKit
2323
24- public protocol SPTableDiffableDelegate : class {
24+ @ objc public protocol SPTableDiffableDelegate : class {
2525
26- func tableView( _ tableView: UITableView , canEditRowAt indexPath: IndexPath ) -> Bool
26+ @ objc optional func tableView( _ tableView: UITableView , canEditRowAt indexPath: IndexPath ) -> Bool
2727
28- func tableView( _ tableView: UITableView , titleForHeaderInSection section: Int ) -> String ?
28+ @ objc optional func tableView( _ tableView: UITableView , titleForHeaderInSection section: Int ) -> String ?
2929
30- func tableView( _ tableView: UITableView , titleForFooterInSection section: Int ) -> String ?
30+ @ objc optional func tableView( _ tableView: UITableView , titleForFooterInSection section: Int ) -> String ?
3131}
You can’t perform that action at this time.
0 commit comments