Skip to content

Commit

Permalink
Merge pull request #1 from ragingo/feature/diffable-datasource
Browse files Browse the repository at this point in the history
UITableViewDataSource -> UITableViewDiffableDataSource 移行&Differentiator への依存をなくす
  • Loading branch information
ragingo authored Dec 14, 2022
2 parents 92565c7 + 00ed3a4 commit 72dfca3
Show file tree
Hide file tree
Showing 10 changed files with 117 additions and 236 deletions.
23 changes: 0 additions & 23 deletions Package.resolved

This file was deleted.

8 changes: 1 addition & 7 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,9 @@ let package = Package(
products: [
.library(name: "RagiSmoothList", targets: ["RagiSmoothList"])
],
dependencies: [
.package(url: "https://github.com/RxSwiftCommunity/RxDataSources", from: "5.0.2")
],
targets: [
.target(
name: "RagiSmoothList",
dependencies: [
.product(name: "Differentiator", package: "RxDataSources")
]
name: "RagiSmoothList"
)
],
swiftLanguageVersions: [.v5]
Expand Down
23 changes: 0 additions & 23 deletions RagiSmoothList/RagiSmoothList.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
52D01E1C2941D19100103B11 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 52D01E1B2941D19100103B11 /* Preview Assets.xcassets */; };
52FF04362942149F0044495F /* InnerTableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52FF04352942149F0044495F /* InnerTableView.swift */; };
52FF043A294216DA0044495F /* RagiSmoothListSectionItemType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52FF0439294216DA0044495F /* RagiSmoothListSectionItemType.swift */; };
52FF043D2942177F0044495F /* Differentiator in Frameworks */ = {isa = PBXBuildFile; productRef = 52FF043C2942177F0044495F /* Differentiator */; };
52FF044429421D9D0044495F /* InfiniteScrollSampleViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52FF044329421D9D0044495F /* InfiniteScrollSampleViewModel.swift */; };
52FF044629421DCF0044495F /* Employee.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52FF044529421DCF0044495F /* Employee.swift */; };
52FF044B29421F810044495F /* RagiSmoothListTextCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52FF044929421F7C0044495F /* RagiSmoothListTextCell.swift */; };
Expand Down Expand Up @@ -101,7 +100,6 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
52FF043D2942177F0044495F /* Differentiator in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -310,7 +308,6 @@
);
name = RagiSmoothList;
packageProductDependencies = (
52FF043C2942177F0044495F /* Differentiator */,
);
productName = RagiSmoothList;
productReference = 52D01DFC2941CE4700103B11 /* RagiSmoothList.framework */;
Expand Down Expand Up @@ -364,7 +361,6 @@
);
mainGroup = 52D01DF22941CE4700103B11;
packageReferences = (
52FF043B2942177F0044495F /* XCRemoteSwiftPackageReference "RxDataSources" */,
);
productRefGroup = 52D01DFD2941CE4700103B11 /* Products */;
projectDirPath = "";
Expand Down Expand Up @@ -711,25 +707,6 @@
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */

/* Begin XCRemoteSwiftPackageReference section */
52FF043B2942177F0044495F /* XCRemoteSwiftPackageReference "RxDataSources" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/RxSwiftCommunity/RxDataSources";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 5.0.0;
};
};
/* End XCRemoteSwiftPackageReference section */

/* Begin XCSwiftPackageProductDependency section */
52FF043C2942177F0044495F /* Differentiator */ = {
isa = XCSwiftPackageProductDependency;
package = 52FF043B2942177F0044495F /* XCRemoteSwiftPackageReference "RxDataSources" */;
productName = Differentiator;
};
/* End XCSwiftPackageProductDependency section */
};
rootObject = 52D01DF32941CE4700103B11 /* Project object */;
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ final class InfiniteScrollSampleViewModel: ObservableObject {
let hireYear: String
}

typealias SectionModelType = RagiSmoothListSectionModel<SectionType, RagiSmoothListSectionItemType<Employee>>
typealias SectionModelType = RagiSmoothListSectionModel<SectionType, Employee>

enum State: Equatable {
case initial
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ struct InfiniteScrollSampleView: View {
SectionHeader(hireYear: section.hireYear)
},
sectionFooterContent: { section in
let subtotal = employees.first(where: { section.id == $0.identity })?.items.count ?? 0
let subtotal = employees.first(where: { section == $0.section })?.items.count ?? 0
SectionFooter(subtotal: subtotal)
},
cellContent: { employee in
Expand Down
Loading

0 comments on commit 72dfca3

Please sign in to comment.