From dd7431d5cb83eeaa8498fbecf6c74775eaf64fac Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Fri, 22 Nov 2019 15:23:21 -0600 Subject: [PATCH] Remove obsolete code. --- iOS/MasterFeed/MasterFeedDataSource.swift | 8 -------- iOS/MasterFeed/MasterFeedViewController.swift | 4 +++- iOS/MasterTimeline/MasterTimelineDataSource.swift | 7 ------- iOS/MasterTimeline/MasterTimelineViewController.swift | 2 +- 4 files changed, 4 insertions(+), 17 deletions(-) diff --git a/iOS/MasterFeed/MasterFeedDataSource.swift b/iOS/MasterFeed/MasterFeedDataSource.swift index 9d6511354..feec33e2e 100644 --- a/iOS/MasterFeed/MasterFeedDataSource.swift +++ b/iOS/MasterFeed/MasterFeedDataSource.swift @@ -13,14 +13,6 @@ import Account class MasterFeedDataSource: UITableViewDiffableDataSource { - private var coordinator: SceneCoordinator! - - init(coordinator: SceneCoordinator, tableView: UITableView, cellProvider: @escaping UITableViewDiffableDataSource.CellProvider) { - super.init(tableView: tableView, cellProvider: cellProvider) - self.coordinator = coordinator - self.defaultRowAnimation = .middle - } - override func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool { guard let node = itemIdentifier(for: indexPath), !(node.representedObject is PseudoFeed) else { return false diff --git a/iOS/MasterFeed/MasterFeedViewController.swift b/iOS/MasterFeed/MasterFeedViewController.swift index 89315194b..649825a4f 100644 --- a/iOS/MasterFeed/MasterFeedViewController.swift +++ b/iOS/MasterFeed/MasterFeedViewController.swift @@ -640,11 +640,13 @@ private extension MasterFeedViewController { } func makeDataSource() -> UITableViewDiffableDataSource { - return MasterFeedDataSource(coordinator: coordinator, tableView: tableView, cellProvider: { [weak self] tableView, indexPath, node in + let dataSource = MasterFeedDataSource(tableView: tableView, cellProvider: { [weak self] tableView, indexPath, node in let cell = tableView.dequeueReusableCell(withIdentifier: "Cell", for: indexPath) as! MasterFeedTableViewCell self?.configure(cell, node) return cell }) + dataSource.defaultRowAnimation = .middle + return dataSource } func resetEstimatedRowHeight() { diff --git a/iOS/MasterTimeline/MasterTimelineDataSource.swift b/iOS/MasterTimeline/MasterTimelineDataSource.swift index ad160e8af..3647a93ae 100644 --- a/iOS/MasterTimeline/MasterTimelineDataSource.swift +++ b/iOS/MasterTimeline/MasterTimelineDataSource.swift @@ -9,13 +9,6 @@ import UIKit class MasterTimelineDataSource: UITableViewDiffableDataSource where SectionIdentifierType : Hashable, ItemIdentifierType : Hashable { - - private var coordinator: SceneCoordinator! - - init(coordinator: SceneCoordinator, tableView: UITableView, cellProvider: @escaping UITableViewDiffableDataSource.CellProvider) { - super.init(tableView: tableView, cellProvider: cellProvider) - self.coordinator = coordinator - } override func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool { return true diff --git a/iOS/MasterTimeline/MasterTimelineViewController.swift b/iOS/MasterTimeline/MasterTimelineViewController.swift index 69d5a5700..8d65ccc34 100644 --- a/iOS/MasterTimeline/MasterTimelineViewController.swift +++ b/iOS/MasterTimeline/MasterTimelineViewController.swift @@ -536,7 +536,7 @@ private extension MasterTimelineViewController { func makeDataSource() -> UITableViewDiffableDataSource { let dataSource: UITableViewDiffableDataSource = - MasterTimelineDataSource(coordinator: coordinator, tableView: tableView, cellProvider: { [weak self] tableView, indexPath, article in + MasterTimelineDataSource(tableView: tableView, cellProvider: { [weak self] tableView, indexPath, article in let cell = tableView.dequeueReusableCell(withIdentifier: "Cell", for: indexPath) as! MasterTimelineTableViewCell self?.configure(cell, article: article) return cell