Move files (#690)
This commit is contained in:
parent
dc91ebcd0a
commit
3a176edb91
|
@ -1199,6 +1199,8 @@
|
||||||
0FB3D2F625E4C24D00AAD544 /* MastodonPickServerViewModel.swift */,
|
0FB3D2F625E4C24D00AAD544 /* MastodonPickServerViewModel.swift */,
|
||||||
DB1FD44F25F26FA1004CFCFC /* MastodonPickServerViewModel+Diffable.swift */,
|
DB1FD44F25F26FA1004CFCFC /* MastodonPickServerViewModel+Diffable.swift */,
|
||||||
DB1FD43525F26899004CFCFC /* MastodonPickServerViewModel+LoadIndexedServerState.swift */,
|
DB1FD43525F26899004CFCFC /* MastodonPickServerViewModel+LoadIndexedServerState.swift */,
|
||||||
|
DB1FD44325F26CCC004CFCFC /* PickServerSection.swift */,
|
||||||
|
DB1E347725F519300079D7DF /* PickServerItem.swift */,
|
||||||
);
|
);
|
||||||
path = PickServer;
|
path = PickServer;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
|
@ -1902,8 +1904,6 @@
|
||||||
DB4F097826A039B400D62E92 /* Onboarding */ = {
|
DB4F097826A039B400D62E92 /* Onboarding */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
DB1FD44325F26CCC004CFCFC /* PickServerSection.swift */,
|
|
||||||
DB1E347725F519300079D7DF /* PickServerItem.swift */,
|
|
||||||
DB1E346725F518E20079D7DF /* CategoryPickerSection.swift */,
|
DB1E346725F518E20079D7DF /* CategoryPickerSection.swift */,
|
||||||
DB1FD45925F27898004CFCFC /* CategoryPickerItem.swift */,
|
DB1FD45925F27898004CFCFC /* CategoryPickerItem.swift */,
|
||||||
DB0618022785A7100030EE79 /* RegisterSection.swift */,
|
DB0618022785A7100030EE79 /* RegisterSection.swift */,
|
||||||
|
|
|
@ -11,7 +11,6 @@ import MastodonSDK
|
||||||
|
|
||||||
/// Note: update Equatable when change case
|
/// Note: update Equatable when change case
|
||||||
enum PickServerItem {
|
enum PickServerItem {
|
||||||
case header
|
|
||||||
case server(server: Mastodon.Entity.Server, attribute: ServerItemAttribute)
|
case server(server: Mastodon.Entity.Server, attribute: ServerItemAttribute)
|
||||||
case loader(attribute: LoaderItemAttribute)
|
case loader(attribute: LoaderItemAttribute)
|
||||||
}
|
}
|
||||||
|
@ -59,8 +58,6 @@ extension PickServerItem {
|
||||||
extension PickServerItem: Equatable {
|
extension PickServerItem: Equatable {
|
||||||
static func == (lhs: PickServerItem, rhs: PickServerItem) -> Bool {
|
static func == (lhs: PickServerItem, rhs: PickServerItem) -> Bool {
|
||||||
switch (lhs, rhs) {
|
switch (lhs, rhs) {
|
||||||
case (.header, .header):
|
|
||||||
return true
|
|
||||||
case (.server(let serverLeft, _), .server(let serverRight, _)):
|
case (.server(let serverLeft, _), .server(let serverRight, _)):
|
||||||
return serverLeft.domain == serverRight.domain
|
return serverLeft.domain == serverRight.domain
|
||||||
case (.loader(let attributeLeft), loader(let attributeRight)):
|
case (.loader(let attributeLeft), loader(let attributeRight)):
|
||||||
|
@ -74,8 +71,6 @@ extension PickServerItem: Equatable {
|
||||||
extension PickServerItem: Hashable {
|
extension PickServerItem: Hashable {
|
||||||
func hash(into hasher: inout Hasher) {
|
func hash(into hasher: inout Hasher) {
|
||||||
switch self {
|
switch self {
|
||||||
case .header:
|
|
||||||
hasher.combine(String(describing: PickServerItem.header.self))
|
|
||||||
case .server(let server, _):
|
case .server(let server, _):
|
||||||
hasher.combine(server.domain)
|
hasher.combine(server.domain)
|
||||||
case .loader(let attribute):
|
case .loader(let attribute):
|
|
@ -20,7 +20,6 @@ extension PickServerSection {
|
||||||
for tableView: UITableView,
|
for tableView: UITableView,
|
||||||
dependency: NeedsDependency
|
dependency: NeedsDependency
|
||||||
) -> UITableViewDiffableDataSource<PickServerSection, PickServerItem> {
|
) -> UITableViewDiffableDataSource<PickServerSection, PickServerItem> {
|
||||||
tableView.register(OnboardingHeadlineTableViewCell.self, forCellReuseIdentifier: String(describing: OnboardingHeadlineTableViewCell.self))
|
|
||||||
tableView.register(PickServerCell.self, forCellReuseIdentifier: String(describing: PickServerCell.self))
|
tableView.register(PickServerCell.self, forCellReuseIdentifier: String(describing: PickServerCell.self))
|
||||||
tableView.register(PickServerLoaderTableViewCell.self, forCellReuseIdentifier: String(describing: PickServerLoaderTableViewCell.self))
|
tableView.register(PickServerLoaderTableViewCell.self, forCellReuseIdentifier: String(describing: PickServerLoaderTableViewCell.self))
|
||||||
|
|
||||||
|
@ -29,9 +28,6 @@ extension PickServerSection {
|
||||||
] tableView, indexPath, item -> UITableViewCell? in
|
] tableView, indexPath, item -> UITableViewCell? in
|
||||||
guard let _ = dependency else { return nil }
|
guard let _ = dependency else { return nil }
|
||||||
switch item {
|
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):
|
case .server(let server, let attribute):
|
||||||
let cell = tableView.dequeueReusableCell(withIdentifier: String(describing: PickServerCell.self), for: indexPath) as! PickServerCell
|
let cell = tableView.dequeueReusableCell(withIdentifier: String(describing: PickServerCell.self), for: indexPath) as! PickServerCell
|
||||||
PickServerSection.configure(cell: cell, server: server, attribute: attribute)
|
PickServerSection.configure(cell: cell, server: server, attribute: attribute)
|
Loading…
Reference in New Issue