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