2019-08-29 01:06:27 +02:00
|
|
|
//
|
|
|
|
// MasterFeedDataSource.swift
|
|
|
|
// NetNewsWire-iOS
|
|
|
|
//
|
|
|
|
// Created by Maurice Parker on 8/28/19.
|
|
|
|
// Copyright © 2019 Ranchero Software. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
import UIKit
|
|
|
|
import RSCore
|
|
|
|
import RSTree
|
|
|
|
import Account
|
|
|
|
|
2019-09-11 12:33:54 +02:00
|
|
|
class MasterFeedDataSource: UITableViewDiffableDataSource<Node, Node> {
|
2019-08-29 01:06:27 +02:00
|
|
|
|
2019-09-01 19:43:07 +02:00
|
|
|
private var coordinator: SceneCoordinator!
|
2019-08-29 01:06:27 +02:00
|
|
|
|
2019-11-21 03:28:24 +01:00
|
|
|
init(coordinator: SceneCoordinator, tableView: UITableView, cellProvider: @escaping UITableViewDiffableDataSource<Node, Node>.CellProvider) {
|
2019-08-29 01:06:27 +02:00
|
|
|
super.init(tableView: tableView, cellProvider: cellProvider)
|
|
|
|
self.coordinator = coordinator
|
2019-11-04 00:45:10 +01:00
|
|
|
self.defaultRowAnimation = .middle
|
2019-08-29 01:06:27 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
override func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool {
|
2019-09-11 12:33:54 +02:00
|
|
|
guard let node = itemIdentifier(for: indexPath), !(node.representedObject is PseudoFeed) else {
|
2019-08-29 01:06:27 +02:00
|
|
|
return false
|
|
|
|
}
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|