Remove obsolete code (#540)
This commit is contained in:
parent
83de4049d8
commit
2d17253c65
|
@ -18,16 +18,14 @@ enum PickServerSection: Equatable, Hashable {
|
||||||
extension PickServerSection {
|
extension PickServerSection {
|
||||||
static func tableViewDiffableDataSource(
|
static func tableViewDiffableDataSource(
|
||||||
for tableView: UITableView,
|
for tableView: UITableView,
|
||||||
dependency: NeedsDependency,
|
dependency: NeedsDependency
|
||||||
pickServerCellDelegate: PickServerCellDelegate
|
|
||||||
) -> UITableViewDiffableDataSource<PickServerSection, PickServerItem> {
|
) -> UITableViewDiffableDataSource<PickServerSection, PickServerItem> {
|
||||||
tableView.register(OnboardingHeadlineTableViewCell.self, forCellReuseIdentifier: String(describing: OnboardingHeadlineTableViewCell.self))
|
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))
|
||||||
|
|
||||||
return UITableViewDiffableDataSource(tableView: tableView) { [
|
return UITableViewDiffableDataSource(tableView: tableView) { [
|
||||||
weak dependency,
|
weak dependency
|
||||||
weak pickServerCellDelegate
|
|
||||||
] 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 {
|
||||||
|
@ -37,7 +35,6 @@ extension PickServerSection {
|
||||||
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)
|
||||||
cell.delegate = pickServerCellDelegate
|
|
||||||
return cell
|
return cell
|
||||||
case .loader(let attribute):
|
case .loader(let attribute):
|
||||||
let cell = tableView.dequeueReusableCell(withIdentifier: String(describing: PickServerLoaderTableViewCell.self), for: indexPath) as! PickServerLoaderTableViewCell
|
let cell = tableView.dequeueReusableCell(withIdentifier: String(describing: PickServerLoaderTableViewCell.self), for: indexPath) as! PickServerLoaderTableViewCell
|
||||||
|
|
|
@ -143,8 +143,7 @@ extension MastodonPickServerViewController {
|
||||||
viewModel.setupDiffableDataSource(
|
viewModel.setupDiffableDataSource(
|
||||||
for: tableView,
|
for: tableView,
|
||||||
dependency: self,
|
dependency: self,
|
||||||
pickServerServerSectionTableHeaderViewDelegate: self,
|
pickServerServerSectionTableHeaderViewDelegate: self
|
||||||
pickServerCellDelegate: self
|
|
||||||
)
|
)
|
||||||
|
|
||||||
KeyboardResponderService
|
KeyboardResponderService
|
||||||
|
@ -504,11 +503,6 @@ extension MastodonPickServerViewController: PickServerServerSectionTableHeaderVi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: - PickServerCellDelegate
|
|
||||||
extension MastodonPickServerViewController: PickServerCellDelegate {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// MARK: - OnboardingViewControllerAppearance
|
// MARK: - OnboardingViewControllerAppearance
|
||||||
extension MastodonPickServerViewController: OnboardingViewControllerAppearance { }
|
extension MastodonPickServerViewController: OnboardingViewControllerAppearance { }
|
||||||
|
|
||||||
|
|
|
@ -13,8 +13,7 @@ extension MastodonPickServerViewModel {
|
||||||
func setupDiffableDataSource(
|
func setupDiffableDataSource(
|
||||||
for tableView: UITableView,
|
for tableView: UITableView,
|
||||||
dependency: NeedsDependency,
|
dependency: NeedsDependency,
|
||||||
pickServerServerSectionTableHeaderViewDelegate: PickServerServerSectionTableHeaderViewDelegate,
|
pickServerServerSectionTableHeaderViewDelegate: PickServerServerSectionTableHeaderViewDelegate
|
||||||
pickServerCellDelegate: PickServerCellDelegate
|
|
||||||
) {
|
) {
|
||||||
// set section header
|
// set section header
|
||||||
serverSectionHeaderView.diffableDataSource = CategoryPickerSection.collectionViewDiffableDataSource(
|
serverSectionHeaderView.diffableDataSource = CategoryPickerSection.collectionViewDiffableDataSource(
|
||||||
|
@ -34,8 +33,7 @@ extension MastodonPickServerViewModel {
|
||||||
// set tableView
|
// set tableView
|
||||||
diffableDataSource = PickServerSection.tableViewDiffableDataSource(
|
diffableDataSource = PickServerSection.tableViewDiffableDataSource(
|
||||||
for: tableView,
|
for: tableView,
|
||||||
dependency: dependency,
|
dependency: dependency
|
||||||
pickServerCellDelegate: pickServerCellDelegate
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var snapshot = NSDiffableDataSourceSnapshot<PickServerSection, PickServerItem>()
|
var snapshot = NSDiffableDataSourceSnapshot<PickServerSection, PickServerItem>()
|
||||||
|
|
|
@ -14,15 +14,8 @@ import Kanna
|
||||||
import MastodonAsset
|
import MastodonAsset
|
||||||
import MastodonLocalization
|
import MastodonLocalization
|
||||||
|
|
||||||
//TODO: @zeitschlag Remove Delegate
|
|
||||||
protocol PickServerCellDelegate: AnyObject {
|
|
||||||
// func pickServerCell(_ cell: PickServerCell, expandButtonPressed button: UIButton)
|
|
||||||
}
|
|
||||||
|
|
||||||
class PickServerCell: UITableViewCell {
|
class PickServerCell: UITableViewCell {
|
||||||
|
|
||||||
weak var delegate: PickServerCellDelegate?
|
|
||||||
|
|
||||||
var disposeBag = Set<AnyCancellable>()
|
var disposeBag = Set<AnyCancellable>()
|
||||||
|
|
||||||
let containerView: UIStackView = {
|
let containerView: UIStackView = {
|
||||||
|
|
Loading…
Reference in New Issue