Move files (#690)

This commit is contained in:
Nathan Mattes 2022-12-13 22:57:35 +01:00
parent dc91ebcd0a
commit 3a176edb91
3 changed files with 2 additions and 11 deletions

View File

@ -1199,6 +1199,8 @@
0FB3D2F625E4C24D00AAD544 /* MastodonPickServerViewModel.swift */,
DB1FD44F25F26FA1004CFCFC /* MastodonPickServerViewModel+Diffable.swift */,
DB1FD43525F26899004CFCFC /* MastodonPickServerViewModel+LoadIndexedServerState.swift */,
DB1FD44325F26CCC004CFCFC /* PickServerSection.swift */,
DB1E347725F519300079D7DF /* PickServerItem.swift */,
);
path = PickServer;
sourceTree = "<group>";
@ -1902,8 +1904,6 @@
DB4F097826A039B400D62E92 /* Onboarding */ = {
isa = PBXGroup;
children = (
DB1FD44325F26CCC004CFCFC /* PickServerSection.swift */,
DB1E347725F519300079D7DF /* PickServerItem.swift */,
DB1E346725F518E20079D7DF /* CategoryPickerSection.swift */,
DB1FD45925F27898004CFCFC /* CategoryPickerItem.swift */,
DB0618022785A7100030EE79 /* RegisterSection.swift */,

View File

@ -11,7 +11,6 @@ import MastodonSDK
/// Note: update Equatable when change case
enum PickServerItem {
case header
case server(server: Mastodon.Entity.Server, attribute: ServerItemAttribute)
case loader(attribute: LoaderItemAttribute)
}
@ -59,8 +58,6 @@ extension PickServerItem {
extension PickServerItem: Equatable {
static func == (lhs: PickServerItem, rhs: PickServerItem) -> Bool {
switch (lhs, rhs) {
case (.header, .header):
return true
case (.server(let serverLeft, _), .server(let serverRight, _)):
return serverLeft.domain == serverRight.domain
case (.loader(let attributeLeft), loader(let attributeRight)):
@ -74,8 +71,6 @@ extension PickServerItem: Equatable {
extension PickServerItem: Hashable {
func hash(into hasher: inout Hasher) {
switch self {
case .header:
hasher.combine(String(describing: PickServerItem.header.self))
case .server(let server, _):
hasher.combine(server.domain)
case .loader(let attribute):

View File

@ -20,7 +20,6 @@ extension PickServerSection {
for tableView: UITableView,
dependency: NeedsDependency
) -> UITableViewDiffableDataSource<PickServerSection, PickServerItem> {
tableView.register(OnboardingHeadlineTableViewCell.self, forCellReuseIdentifier: String(describing: OnboardingHeadlineTableViewCell.self))
tableView.register(PickServerCell.self, forCellReuseIdentifier: String(describing: PickServerCell.self))
tableView.register(PickServerLoaderTableViewCell.self, forCellReuseIdentifier: String(describing: PickServerLoaderTableViewCell.self))
@ -29,9 +28,6 @@ extension PickServerSection {
] tableView, indexPath, item -> UITableViewCell? in
guard let _ = dependency else { return nil }
switch item {
case .header:
let cell = tableView.dequeueReusableCell(withIdentifier: String(describing: OnboardingHeadlineTableViewCell.self), for: indexPath) as! OnboardingHeadlineTableViewCell
return cell
case .server(let server, let attribute):
let cell = tableView.dequeueReusableCell(withIdentifier: String(describing: PickServerCell.self), for: indexPath) as! PickServerCell
PickServerSection.configure(cell: cell, server: server, attribute: attribute)