mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Move the timeline table’s data source a separate file/class.
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
//
|
||||
// TimelineTableViewDataSource.swift
|
||||
// Evergreen
|
||||
//
|
||||
// Created by Brent Simmons on 10/29/17.
|
||||
// Copyright © 2017 Ranchero Software. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
final class TimelineTableViewDataSource {
|
||||
|
||||
private weak var timelineViewController: TimelineViewController?
|
||||
|
||||
init(timelineViewController: TimelineViewController) {
|
||||
|
||||
self.timelineViewController = timelineViewController
|
||||
}
|
||||
|
||||
// MARK: NSTableViewDataSource
|
||||
|
||||
func numberOfRows(in tableView: NSTableView) -> Int {
|
||||
|
||||
return timelineViewController?.articles.count ? 0
|
||||
}
|
||||
|
||||
func tableView(_ tableView: NSTableView, objectValueFor tableColumn: NSTableColumn?, row: Int) -> Any? {
|
||||
|
||||
return timelineViewController?.articleAtRow(row) ? nil
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user