Skip to content

Commit eb09652

Browse files
committed
Rename diffable delegate to mediator
1 parent 837688f commit eb09652

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

SPDiffable.xcodeproj/project.pbxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10-
F4632035249EBA7100AF7413 /* SPTableDiffableDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4632034249EBA7100AF7413 /* SPTableDiffableDelegate.swift */; };
10+
F4632035249EBA7100AF7413 /* SPTableDiffableMediator.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4632034249EBA7100AF7413 /* SPTableDiffableMediator.swift */; };
1111
F4954BE2249B788A007072FA /* SPDiffable.h in Headers */ = {isa = PBXBuildFile; fileRef = F4954BE0249B788A007072FA /* SPDiffable.h */; settings = {ATTRIBUTES = (Public, ); }; };
1212
F4954BEE249B95F2007072FA /* FUNDING.yml in Resources */ = {isa = PBXBuildFile; fileRef = F4954BED249B95F2007072FA /* FUNDING.yml */; };
1313
F4954BF7249B962C007072FA /* Readme.md in Resources */ = {isa = PBXBuildFile; fileRef = F4954BF2249B962C007072FA /* Readme.md */; };
@@ -22,7 +22,7 @@
2222
/* End PBXBuildFile section */
2323

2424
/* Begin PBXFileReference section */
25-
F4632034249EBA7100AF7413 /* SPTableDiffableDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SPTableDiffableDelegate.swift; sourceTree = "<group>"; };
25+
F4632034249EBA7100AF7413 /* SPTableDiffableMediator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SPTableDiffableMediator.swift; sourceTree = "<group>"; };
2626
F4954BDD249B788A007072FA /* SPDiffable.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SPDiffable.framework; sourceTree = BUILT_PRODUCTS_DIR; };
2727
F4954BE0249B788A007072FA /* SPDiffable.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SPDiffable.h; sourceTree = "<group>"; };
2828
F4954BE1249B788A007072FA /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
@@ -142,7 +142,7 @@
142142
children = (
143143
F4632036249EBB9200AF7413 /* Views */,
144144
F4954C00249B9715007072FA /* SPTableDiffableDataSource.swift */,
145-
F4632034249EBA7100AF7413 /* SPTableDiffableDelegate.swift */,
145+
F4632034249EBA7100AF7413 /* SPTableDiffableMediator.swift */,
146146
);
147147
path = Table;
148148
sourceTree = "<group>";
@@ -236,7 +236,7 @@
236236
F4954C03249B9716007072FA /* SPDiffableFooter.swift in Sources */,
237237
F4954C06249B9716007072FA /* SPDiffableSection.swift in Sources */,
238238
F4954C07249B9716007072FA /* SPDiffableTableView.swift in Sources */,
239-
F4632035249EBA7100AF7413 /* SPTableDiffableDelegate.swift in Sources */,
239+
F4632035249EBA7100AF7413 /* SPTableDiffableMediator.swift in Sources */,
240240
F4954C08249B9716007072FA /* SPTableDiffableDataSource.swift in Sources */,
241241
);
242242
runOnlyForDeploymentPostprocessing = 0;

Source/SPDiffable/Table/SPTableDiffableDataSource.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import UIKit
2323

2424
open class SPTableDiffableDataSource: UITableViewDiffableDataSource<SPDiffableSection, SPDiffableItem> {
2525

26-
public weak var diffableDelegate: SPTableDiffableDelegate?
26+
public weak var mediator: SPTableDiffableMediator?
2727

2828
public init(tableView: UITableView, cellProviders: [CellProvider]) {
2929
super.init(tableView: tableView, cellProvider: { (tableView, indexPath, model) -> UITableViewCell? in
@@ -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 = mediator?.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 = mediator?.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 mediator?.tableView?(tableView, canEditRowAt: indexPath) ?? false
7171
}
7272
}
7373

Source/SPDiffable/Table/SPTableDiffableDelegate.swift renamed to Source/SPDiffable/Table/SPTableDiffableMediator.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
import UIKit
2323

24-
@objc public protocol SPTableDiffableDelegate: class {
24+
@objc public protocol SPTableDiffableMediator: class {
2525

2626
@objc optional func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool
2727

0 commit comments

Comments
 (0)