Continue reconciling names with 6.1.6-ios branch.
This commit is contained in:
parent
9cc4db638c
commit
d4807e6a88
@ -914,11 +914,11 @@ private extension MainWindowController {
|
|||||||
return viewController.children.first as? NSSplitViewController
|
return viewController.children.first as? NSSplitViewController
|
||||||
}
|
}
|
||||||
|
|
||||||
var currentTimelineViewController: TimelineViewController? {
|
var currentTimelineViewController: MainTimelineViewController? {
|
||||||
return timelineContainerViewController?.currentTimelineViewController
|
return timelineContainerViewController?.currentTimelineViewController
|
||||||
}
|
}
|
||||||
|
|
||||||
var regularTimelineViewController: TimelineViewController? {
|
var regularTimelineViewController: MainTimelineViewController? {
|
||||||
return timelineContainerViewController?.regularTimelineViewController
|
return timelineContainerViewController?.regularTimelineViewController
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -153,7 +153,7 @@ protocol SidebarDelegate: AnyObject {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if let timelineViewController = representedObject as? TimelineViewController {
|
if let timelineViewController = representedObject as? MainTimelineViewController {
|
||||||
configureUnreadCountForCellsForRepresentedObjects(timelineViewController.representedObjects)
|
configureUnreadCountForCellsForRepresentedObjects(timelineViewController.representedObjects)
|
||||||
} else {
|
} else {
|
||||||
configureUnreadCountForCellsForRepresentedObjects([representedObject as AnyObject])
|
configureUnreadCountForCellsForRepresentedObjects([representedObject as AnyObject])
|
||||||
|
@ -13,7 +13,7 @@ import RSCore
|
|||||||
|
|
||||||
@objc final class TimelineKeyboardDelegate: NSObject, KeyboardDelegate {
|
@objc final class TimelineKeyboardDelegate: NSObject, KeyboardDelegate {
|
||||||
|
|
||||||
@IBOutlet weak var timelineViewController: TimelineViewController?
|
@IBOutlet weak var timelineViewController: MainTimelineViewController?
|
||||||
let shortcuts: Set<KeyboardShortcut>
|
let shortcuts: Set<KeyboardShortcut>
|
||||||
|
|
||||||
override init() {
|
override init() {
|
||||||
|
@ -13,9 +13,9 @@ import Account
|
|||||||
import os.log
|
import os.log
|
||||||
|
|
||||||
protocol TimelineDelegate: AnyObject {
|
protocol TimelineDelegate: AnyObject {
|
||||||
func timelineSelectionDidChange(_: TimelineViewController, selectedArticles: [Article]?)
|
func timelineSelectionDidChange(_: MainTimelineViewController, selectedArticles: [Article]?)
|
||||||
func timelineRequestedFeedSelection(_: TimelineViewController, feed: Feed)
|
func timelineRequestedFeedSelection(_: MainTimelineViewController, feed: Feed)
|
||||||
func timelineInvalidatedRestorationState(_: TimelineViewController)
|
func timelineInvalidatedRestorationState(_: MainTimelineViewController)
|
||||||
}
|
}
|
||||||
|
|
||||||
enum TimelineShowFeedName {
|
enum TimelineShowFeedName {
|
||||||
@ -24,7 +24,7 @@ enum TimelineShowFeedName {
|
|||||||
case feed
|
case feed
|
||||||
}
|
}
|
||||||
|
|
||||||
final class TimelineViewController: NSViewController, UndoableCommandRunner, UnreadCountProvider {
|
final class MainTimelineViewController: NSViewController, UndoableCommandRunner, UnreadCountProvider {
|
||||||
|
|
||||||
@IBOutlet var tableView: TimelineTableView!
|
@IBOutlet var tableView: TimelineTableView!
|
||||||
|
|
||||||
@ -759,7 +759,7 @@ final class TimelineViewController: NSViewController, UndoableCommandRunner, Unr
|
|||||||
|
|
||||||
// MARK: - NSMenuDelegate
|
// MARK: - NSMenuDelegate
|
||||||
|
|
||||||
extension TimelineViewController: NSMenuDelegate {
|
extension MainTimelineViewController: NSMenuDelegate {
|
||||||
|
|
||||||
public func menuNeedsUpdate(_ menu: NSMenu) {
|
public func menuNeedsUpdate(_ menu: NSMenu) {
|
||||||
menu.removeAllItems()
|
menu.removeAllItems()
|
||||||
@ -772,7 +772,7 @@ extension TimelineViewController: NSMenuDelegate {
|
|||||||
|
|
||||||
// MARK: - NSUserInterfaceValidations
|
// MARK: - NSUserInterfaceValidations
|
||||||
|
|
||||||
extension TimelineViewController: NSUserInterfaceValidations {
|
extension MainTimelineViewController: NSUserInterfaceValidations {
|
||||||
|
|
||||||
func validateUserInterfaceItem(_ item: NSValidatedUserInterfaceItem) -> Bool {
|
func validateUserInterfaceItem(_ item: NSValidatedUserInterfaceItem) -> Bool {
|
||||||
if item.action == #selector(openArticleInBrowser(_:)) {
|
if item.action == #selector(openArticleInBrowser(_:)) {
|
||||||
@ -794,7 +794,7 @@ extension TimelineViewController: NSUserInterfaceValidations {
|
|||||||
|
|
||||||
// MARK: - NSTableViewDataSource
|
// MARK: - NSTableViewDataSource
|
||||||
|
|
||||||
extension TimelineViewController: NSTableViewDataSource {
|
extension MainTimelineViewController: NSTableViewDataSource {
|
||||||
func numberOfRows(in tableView: NSTableView) -> Int {
|
func numberOfRows(in tableView: NSTableView) -> Int {
|
||||||
return articles.count
|
return articles.count
|
||||||
}
|
}
|
||||||
@ -813,15 +813,15 @@ extension TimelineViewController: NSTableViewDataSource {
|
|||||||
|
|
||||||
// MARK: - NSTableViewDelegate
|
// MARK: - NSTableViewDelegate
|
||||||
|
|
||||||
extension TimelineViewController: NSTableViewDelegate {
|
extension MainTimelineViewController: NSTableViewDelegate {
|
||||||
private static let rowViewIdentifier = NSUserInterfaceItemIdentifier(rawValue: "timelineRow")
|
private static let rowViewIdentifier = NSUserInterfaceItemIdentifier(rawValue: "timelineRow")
|
||||||
|
|
||||||
func tableView(_ tableView: NSTableView, rowViewForRow row: Int) -> NSTableRowView? {
|
func tableView(_ tableView: NSTableView, rowViewForRow row: Int) -> NSTableRowView? {
|
||||||
if let rowView: TimelineTableRowView = tableView.makeView(withIdentifier: TimelineViewController.rowViewIdentifier, owner: nil) as? TimelineTableRowView {
|
if let rowView: TimelineTableRowView = tableView.makeView(withIdentifier: MainTimelineViewController.rowViewIdentifier, owner: nil) as? TimelineTableRowView {
|
||||||
return rowView
|
return rowView
|
||||||
}
|
}
|
||||||
let rowView = TimelineTableRowView()
|
let rowView = TimelineTableRowView()
|
||||||
rowView.identifier = TimelineViewController.rowViewIdentifier
|
rowView.identifier = MainTimelineViewController.rowViewIdentifier
|
||||||
return rowView
|
return rowView
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -839,13 +839,13 @@ extension TimelineViewController: NSTableViewDelegate {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if let cell = tableView.makeView(withIdentifier: TimelineViewController.timelineCellIdentifier, owner: nil) as? TimelineTableCellView {
|
if let cell = tableView.makeView(withIdentifier: MainTimelineViewController.timelineCellIdentifier, owner: nil) as? TimelineTableCellView {
|
||||||
configure(cell)
|
configure(cell)
|
||||||
return cell
|
return cell
|
||||||
}
|
}
|
||||||
|
|
||||||
let cell = TimelineTableCellView()
|
let cell = TimelineTableCellView()
|
||||||
cell.identifier = TimelineViewController.timelineCellIdentifier
|
cell.identifier = MainTimelineViewController.timelineCellIdentifier
|
||||||
configure(cell)
|
configure(cell)
|
||||||
return cell
|
return cell
|
||||||
}
|
}
|
||||||
@ -943,7 +943,7 @@ extension TimelineViewController: NSTableViewDelegate {
|
|||||||
|
|
||||||
// MARK: - Private
|
// MARK: - Private
|
||||||
|
|
||||||
private extension TimelineViewController {
|
private extension MainTimelineViewController {
|
||||||
|
|
||||||
func fetchAndReplacePreservingSelection() {
|
func fetchAndReplacePreservingSelection() {
|
||||||
if let article = oneSelectedArticle, let account = article.account {
|
if let article = oneSelectedArticle, let account = article.account {
|
||||||
@ -1187,7 +1187,7 @@ private extension TimelineViewController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func queueFetchAndMergeArticles() {
|
func queueFetchAndMergeArticles() {
|
||||||
TimelineViewController.fetchAndMergeArticlesQueue.add(self, #selector(fetchAndMergeArticles))
|
MainTimelineViewController.fetchAndMergeArticlesQueue.add(self, #selector(fetchAndMergeArticles))
|
||||||
}
|
}
|
||||||
|
|
||||||
func representedObjectArraysAreEqual(_ objects1: [AnyObject]?, _ objects2: [AnyObject]?) -> Bool {
|
func representedObjectArraysAreEqual(_ objects1: [AnyObject]?, _ objects2: [AnyObject]?) -> Bool {
|
@ -27,7 +27,7 @@ final class TimelineContainerViewController: NSViewController {
|
|||||||
@IBOutlet weak var readFilteredButton: NSButton!
|
@IBOutlet weak var readFilteredButton: NSButton!
|
||||||
@IBOutlet var containerView: TimelineContainerView!
|
@IBOutlet var containerView: TimelineContainerView!
|
||||||
|
|
||||||
var currentTimelineViewController: TimelineViewController? {
|
var currentTimelineViewController: MainTimelineViewController? {
|
||||||
didSet {
|
didSet {
|
||||||
let view = currentTimelineViewController?.view
|
let view = currentTimelineViewController?.view
|
||||||
if containerView.contentView === view {
|
if containerView.contentView === view {
|
||||||
@ -51,10 +51,10 @@ final class TimelineContainerViewController: NSViewController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
lazy var regularTimelineViewController = {
|
lazy var regularTimelineViewController = {
|
||||||
return TimelineViewController(delegate: self)
|
return MainTimelineViewController(delegate: self)
|
||||||
}()
|
}()
|
||||||
private lazy var searchTimelineViewController: TimelineViewController = {
|
private lazy var searchTimelineViewController: MainTimelineViewController = {
|
||||||
let viewController = TimelineViewController(delegate: self)
|
let viewController = MainTimelineViewController(delegate: self)
|
||||||
viewController.showsSearchResults = true
|
viewController.showsSearchResults = true
|
||||||
return viewController
|
return viewController
|
||||||
}()
|
}()
|
||||||
@ -137,15 +137,15 @@ final class TimelineContainerViewController: NSViewController {
|
|||||||
|
|
||||||
extension TimelineContainerViewController: TimelineDelegate {
|
extension TimelineContainerViewController: TimelineDelegate {
|
||||||
|
|
||||||
func timelineSelectionDidChange(_ timelineViewController: TimelineViewController, selectedArticles: [Article]?) {
|
func timelineSelectionDidChange(_ timelineViewController: MainTimelineViewController, selectedArticles: [Article]?) {
|
||||||
delegate?.timelineSelectionDidChange(self, articles: selectedArticles, mode: mode(for: timelineViewController))
|
delegate?.timelineSelectionDidChange(self, articles: selectedArticles, mode: mode(for: timelineViewController))
|
||||||
}
|
}
|
||||||
|
|
||||||
func timelineRequestedFeedSelection(_: TimelineViewController, feed: Feed) {
|
func timelineRequestedFeedSelection(_: MainTimelineViewController, feed: Feed) {
|
||||||
delegate?.timelineRequestedFeedSelection(self, feed: feed)
|
delegate?.timelineRequestedFeedSelection(self, feed: feed)
|
||||||
}
|
}
|
||||||
|
|
||||||
func timelineInvalidatedRestorationState(_: TimelineViewController) {
|
func timelineInvalidatedRestorationState(_: MainTimelineViewController) {
|
||||||
delegate?.timelineInvalidatedRestorationState(self)
|
delegate?.timelineInvalidatedRestorationState(self)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -158,7 +158,7 @@ private extension TimelineContainerViewController {
|
|||||||
attributes: [NSAttributedString.Key.font: NSFont.controlContentFont(ofSize: NSFont.systemFontSize)])
|
attributes: [NSAttributedString.Key.font: NSFont.controlContentFont(ofSize: NSFont.systemFontSize)])
|
||||||
}
|
}
|
||||||
|
|
||||||
func timelineViewController(for mode: TimelineSourceMode) -> TimelineViewController {
|
func timelineViewController(for mode: TimelineSourceMode) -> MainTimelineViewController {
|
||||||
switch mode {
|
switch mode {
|
||||||
case .regular:
|
case .regular:
|
||||||
return regularTimelineViewController
|
return regularTimelineViewController
|
||||||
@ -167,7 +167,7 @@ private extension TimelineContainerViewController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func mode(for timelineViewController: TimelineViewController) -> TimelineSourceMode {
|
func mode(for timelineViewController: MainTimelineViewController) -> TimelineSourceMode {
|
||||||
if timelineViewController === regularTimelineViewController {
|
if timelineViewController === regularTimelineViewController {
|
||||||
return .regular
|
return .regular
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
|
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="23504" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14460.31"/>
|
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="23504"/>
|
||||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<objects>
|
<objects>
|
||||||
<customObject id="-2" userLabel="File's Owner" customClass="TimelineViewController" customModule="NetNewsWire" customModuleProvider="target">
|
<customObject id="-2" userLabel="File's Owner" customClass="MainTimelineViewController" customModule="NetNewsWire" customModuleProvider="target">
|
||||||
<connections>
|
<connections>
|
||||||
<outlet property="tableView" destination="opA-RM-DKR" id="Hnf-mE-gcq"/>
|
<outlet property="tableView" destination="opA-RM-DKR" id="Hnf-mE-gcq"/>
|
||||||
<outlet property="view" destination="dbt-sN-FU2" id="96u-gC-hW0"/>
|
<outlet property="view" destination="dbt-sN-FU2" id="96u-gC-hW0"/>
|
||||||
@ -18,17 +18,16 @@
|
|||||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||||
<clipView key="contentView" copiesOnScroll="NO" id="zef-7R-cWt">
|
<clipView key="contentView" copiesOnScroll="NO" id="zef-7R-cWt">
|
||||||
<rect key="frame" x="0.0" y="0.0" width="450" height="198"/>
|
<rect key="frame" x="0.0" y="0.0" width="450" height="198"/>
|
||||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
<autoresizingMask key="autoresizingMask"/>
|
||||||
<subviews>
|
<subviews>
|
||||||
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" columnReordering="NO" columnResizing="NO" autosaveColumns="NO" typeSelect="NO" rowHeight="96" viewBased="YES" id="opA-RM-DKR" customClass="TimelineTableView" customModule="NetNewsWire" customModuleProvider="target">
|
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" columnReordering="NO" columnResizing="NO" autosaveColumns="NO" typeSelect="NO" rowHeight="96" viewBased="YES" id="opA-RM-DKR" customClass="TimelineTableView" customModule="NetNewsWire" customModuleProvider="target">
|
||||||
<rect key="frame" x="0.0" y="0.0" width="450" height="198"/>
|
<rect key="frame" x="0.0" y="0.0" width="450" height="198"/>
|
||||||
<autoresizingMask key="autoresizingMask"/>
|
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||||
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
|
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||||
<color key="gridColor" name="gridColor" catalog="System" colorSpace="catalog"/>
|
<color key="gridColor" name="gridColor" catalog="System" colorSpace="catalog"/>
|
||||||
<tableColumns>
|
<tableColumns>
|
||||||
<tableColumn width="447" minWidth="40" maxWidth="1000" id="PRn-8s-32o">
|
<tableColumn width="415" minWidth="40" maxWidth="1000" id="PRn-8s-32o">
|
||||||
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border">
|
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border">
|
||||||
<font key="font" metaFont="smallSystem"/>
|
|
||||||
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
|
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
|
||||||
<color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
|
<color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
|
||||||
</tableHeaderCell>
|
</tableHeaderCell>
|
||||||
|
@ -11,7 +11,7 @@ import RSCore
|
|||||||
import Articles
|
import Articles
|
||||||
import Account
|
import Account
|
||||||
|
|
||||||
extension TimelineViewController {
|
extension MainTimelineViewController {
|
||||||
|
|
||||||
func contextualMenuForClickedRows() -> NSMenu? {
|
func contextualMenuForClickedRows() -> NSMenu? {
|
||||||
|
|
||||||
@ -30,7 +30,7 @@ extension TimelineViewController {
|
|||||||
|
|
||||||
// MARK: Contextual Menu Actions
|
// MARK: Contextual Menu Actions
|
||||||
|
|
||||||
extension TimelineViewController {
|
extension MainTimelineViewController {
|
||||||
|
|
||||||
@objc func markArticlesReadFromContextualMenu(_ sender: Any?) {
|
@objc func markArticlesReadFromContextualMenu(_ sender: Any?) {
|
||||||
guard let articles = articles(from: sender) else { return }
|
guard let articles = articles(from: sender) else { return }
|
||||||
@ -107,7 +107,7 @@ extension TimelineViewController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private extension TimelineViewController {
|
private extension MainTimelineViewController {
|
||||||
|
|
||||||
func markArticles(_ articles: [Article], read: Bool) {
|
func markArticles(_ articles: [Article], read: Bool) {
|
||||||
markArticles(articles, statusKey: .read, flag: read)
|
markArticles(articles, statusKey: .read, flag: read)
|
||||||
|
@ -112,7 +112,7 @@
|
|||||||
<!--Timeline-->
|
<!--Timeline-->
|
||||||
<scene sceneID="fag-XH-avP">
|
<scene sceneID="fag-XH-avP">
|
||||||
<objects>
|
<objects>
|
||||||
<tableViewController storyboardIdentifier="TimelineViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" clearsSelectionOnViewWillAppear="NO" id="Kyk-vK-QRX" customClass="TimelineViewController" customModule="NetNewsWire" customModuleProvider="target" sceneMemberID="viewController">
|
<tableViewController storyboardIdentifier="TimelineViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" clearsSelectionOnViewWillAppear="NO" id="Kyk-vK-QRX" customClass="MainTimelineViewController" customModule="NetNewsWire" customModuleProvider="target" sceneMemberID="viewController">
|
||||||
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" keyboardDismissMode="onDrag" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" id="mtv-Ik-FoJ">
|
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" keyboardDismissMode="onDrag" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" id="mtv-Ik-FoJ">
|
||||||
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
|
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
|
||||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// TimelineDataSource.swift
|
// MainTimelineDataSource.swift
|
||||||
// NetNewsWire-iOS
|
// NetNewsWire-iOS
|
||||||
//
|
//
|
||||||
// Created by Maurice Parker on 8/30/19.
|
// Created by Maurice Parker on 8/30/19.
|
||||||
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
import UIKit
|
import UIKit
|
||||||
|
|
||||||
class TimelineDataSource<SectionIdentifierType, ItemIdentifierType>: UITableViewDiffableDataSource<SectionIdentifierType, ItemIdentifierType> where SectionIdentifierType : Hashable, ItemIdentifierType : Hashable {
|
class MainTimelineDataSource<SectionIdentifierType, ItemIdentifierType>: UITableViewDiffableDataSource<SectionIdentifierType, ItemIdentifierType> where SectionIdentifierType : Hashable, ItemIdentifierType : Hashable {
|
||||||
|
|
||||||
override func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool {
|
override func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool {
|
||||||
return true
|
return true
|
@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// FeedTitleView.swift
|
// MainTimelineTitleView.swift
|
||||||
// NetNewsWire-iOS
|
// NetNewsWire-iOS
|
||||||
//
|
//
|
||||||
// Created by Maurice Parker on 9/21/19.
|
// Created by Maurice Parker on 9/21/19.
|
||||||
@ -8,11 +8,11 @@
|
|||||||
|
|
||||||
import UIKit
|
import UIKit
|
||||||
|
|
||||||
class TimelineTitleView: UIView {
|
class MainTimelineTitleView: UIView {
|
||||||
|
|
||||||
@IBOutlet weak var iconView: IconView!
|
@IBOutlet weak var iconView: IconView!
|
||||||
@IBOutlet weak var label: UILabel!
|
@IBOutlet weak var label: UILabel!
|
||||||
@IBOutlet weak var unreadCountView: TimelineUnreadCountView!
|
@IBOutlet weak var unreadCountView: MainTimelineUnreadCountView!
|
||||||
|
|
||||||
private lazy var pointerInteraction: UIPointerInteraction = {
|
private lazy var pointerInteraction: UIPointerInteraction = {
|
||||||
UIPointerInteraction(delegate: self)
|
UIPointerInteraction(delegate: self)
|
||||||
@ -44,7 +44,7 @@ class TimelineTitleView: UIView {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extension TimelineTitleView: UIPointerInteractionDelegate {
|
extension MainTimelineTitleView: UIPointerInteractionDelegate {
|
||||||
|
|
||||||
func pointerInteraction(_ interaction: UIPointerInteraction, styleFor region: UIPointerRegion) -> UIPointerStyle? {
|
func pointerInteraction(_ interaction: UIPointerInteraction, styleFor region: UIPointerRegion) -> UIPointerStyle? {
|
||||||
var rect = self.frame
|
var rect = self.frame
|
@ -9,7 +9,7 @@
|
|||||||
<objects>
|
<objects>
|
||||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
|
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
|
||||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||||
<view contentMode="scaleToFill" id="iN0-l3-epB" customClass="TimelineTitleView" customModule="NetNewsWire" customModuleProvider="target">
|
<view contentMode="scaleToFill" id="iN0-l3-epB" customClass="MainTimelineTitleView" customModule="NetNewsWire" customModuleProvider="target">
|
||||||
<rect key="frame" x="0.0" y="0.0" width="190" height="38"/>
|
<rect key="frame" x="0.0" y="0.0" width="190" height="38"/>
|
||||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||||
<subviews>
|
<subviews>
|
||||||
@ -19,7 +19,7 @@
|
|||||||
<nil key="textColor"/>
|
<nil key="textColor"/>
|
||||||
<nil key="highlightedColor"/>
|
<nil key="highlightedColor"/>
|
||||||
</label>
|
</label>
|
||||||
<view verifyAmbiguity="off" opaque="NO" contentMode="scaleToFill" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="z9o-XA-3t4" customClass="TimelineUnreadCountView" customModule="NetNewsWire" customModuleProvider="target">
|
<view verifyAmbiguity="off" opaque="NO" contentMode="scaleToFill" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="z9o-XA-3t4" customClass="MainTimelineUnreadCountView" customModule="NetNewsWire" customModuleProvider="target">
|
||||||
<rect key="frame" x="79.5" y="9" width="110.5" height="20"/>
|
<rect key="frame" x="79.5" y="9" width="110.5" height="20"/>
|
||||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||||
</view>
|
</view>
|
@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// TimelineUnreadCountView.swift
|
// MainTimelineUnreadCountView.swift
|
||||||
// NetNewsWire-iOS
|
// NetNewsWire-iOS
|
||||||
//
|
//
|
||||||
// Created by Maurice Parker on 9/30/19.
|
// Created by Maurice Parker on 9/30/19.
|
||||||
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
import UIKit
|
import UIKit
|
||||||
|
|
||||||
class TimelineUnreadCountView: MainFeedUnreadCountView {
|
class MainTimelineUnreadCountView: MainFeedUnreadCountView {
|
||||||
|
|
||||||
override var padding: UIEdgeInsets {
|
override var padding: UIEdgeInsets {
|
||||||
return UIEdgeInsets(top: 2.0, left: 9.0, bottom: 2.0, right: 9.0)
|
return UIEdgeInsets(top: 2.0, left: 9.0, bottom: 2.0, right: 9.0)
|
@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// TimelineViewController.swift
|
// MainTimelineViewController.swift
|
||||||
// NetNewsWire
|
// NetNewsWire
|
||||||
//
|
//
|
||||||
// Created by Maurice Parker on 4/8/19.
|
// Created by Maurice Parker on 4/8/19.
|
||||||
@ -11,7 +11,7 @@ import RSCore
|
|||||||
import Account
|
import Account
|
||||||
import Articles
|
import Articles
|
||||||
|
|
||||||
class TimelineViewController: UITableViewController, UndoableCommandRunner {
|
class MainTimelineViewController: UITableViewController, UndoableCommandRunner {
|
||||||
|
|
||||||
private var numberOfTextLines = 0
|
private var numberOfTextLines = 0
|
||||||
private var iconSize = IconSize.medium
|
private var iconSize = IconSize.medium
|
||||||
@ -85,7 +85,7 @@ class TimelineViewController: UITableViewController, UndoableCommandRunner {
|
|||||||
iconSize = AppDefaults.shared.timelineIconSize
|
iconSize = AppDefaults.shared.timelineIconSize
|
||||||
resetEstimatedRowHeight()
|
resetEstimatedRowHeight()
|
||||||
|
|
||||||
if let titleView = Bundle.main.loadNibNamed("TimelineTitleView", owner: self, options: nil)?[0] as? TimelineTitleView {
|
if let titleView = Bundle.main.loadNibNamed("TimelineTitleView", owner: self, options: nil)?[0] as? MainTimelineTitleView {
|
||||||
navigationItem.titleView = titleView
|
navigationItem.titleView = titleView
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -445,7 +445,7 @@ class TimelineViewController: UITableViewController, UndoableCommandRunner {
|
|||||||
|
|
||||||
@objc func feedIconDidBecomeAvailable(_ note: Notification) {
|
@objc func feedIconDidBecomeAvailable(_ note: Notification) {
|
||||||
|
|
||||||
if let titleView = navigationItem.titleView as? TimelineTitleView {
|
if let titleView = navigationItem.titleView as? MainTimelineTitleView {
|
||||||
titleView.iconView.iconImage = coordinator.timelineIconImage
|
titleView.iconView.iconImage = coordinator.timelineIconImage
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -483,7 +483,7 @@ class TimelineViewController: UITableViewController, UndoableCommandRunner {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@objc func faviconDidBecomeAvailable(_ note: Notification) {
|
@objc func faviconDidBecomeAvailable(_ note: Notification) {
|
||||||
if let titleView = navigationItem.titleView as? TimelineTitleView {
|
if let titleView = navigationItem.titleView as? MainTimelineTitleView {
|
||||||
titleView.iconView.iconImage = coordinator.timelineIconImage
|
titleView.iconView.iconImage = coordinator.timelineIconImage
|
||||||
}
|
}
|
||||||
if coordinator.showIcons {
|
if coordinator.showIcons {
|
||||||
@ -508,7 +508,7 @@ class TimelineViewController: UITableViewController, UndoableCommandRunner {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@objc func displayNameDidChange(_ note: Notification) {
|
@objc func displayNameDidChange(_ note: Notification) {
|
||||||
if let titleView = navigationItem.titleView as? TimelineTitleView {
|
if let titleView = navigationItem.titleView as? MainTimelineTitleView {
|
||||||
titleView.label.text = coordinator.timelineFeed?.nameForDisplay
|
titleView.label.text = coordinator.timelineFeed?.nameForDisplay
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -564,7 +564,7 @@ class TimelineViewController: UITableViewController, UndoableCommandRunner {
|
|||||||
|
|
||||||
// MARK: Searching
|
// MARK: Searching
|
||||||
|
|
||||||
extension TimelineViewController: UISearchControllerDelegate {
|
extension MainTimelineViewController: UISearchControllerDelegate {
|
||||||
|
|
||||||
func willPresentSearchController(_ searchController: UISearchController) {
|
func willPresentSearchController(_ searchController: UISearchController) {
|
||||||
coordinator.beginSearching()
|
coordinator.beginSearching()
|
||||||
@ -578,7 +578,7 @@ extension TimelineViewController: UISearchControllerDelegate {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
extension TimelineViewController: UISearchResultsUpdating {
|
extension MainTimelineViewController: UISearchResultsUpdating {
|
||||||
|
|
||||||
func updateSearchResults(for searchController: UISearchController) {
|
func updateSearchResults(for searchController: UISearchController) {
|
||||||
let searchScope = SearchScope(rawValue: searchController.searchBar.selectedScopeButtonIndex)!
|
let searchScope = SearchScope(rawValue: searchController.searchBar.selectedScopeButtonIndex)!
|
||||||
@ -587,7 +587,7 @@ extension TimelineViewController: UISearchResultsUpdating {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
extension TimelineViewController: UISearchBarDelegate {
|
extension MainTimelineViewController: UISearchBarDelegate {
|
||||||
func searchBar(_ searchBar: UISearchBar, selectedScopeButtonIndexDidChange selectedScope: Int) {
|
func searchBar(_ searchBar: UISearchBar, selectedScopeButtonIndexDidChange selectedScope: Int) {
|
||||||
let searchScope = SearchScope(rawValue: selectedScope)!
|
let searchScope = SearchScope(rawValue: selectedScope)!
|
||||||
coordinator.searchArticles(searchBar.text!, searchScope)
|
coordinator.searchArticles(searchBar.text!, searchScope)
|
||||||
@ -596,7 +596,7 @@ extension TimelineViewController: UISearchBarDelegate {
|
|||||||
|
|
||||||
// MARK: Private
|
// MARK: Private
|
||||||
|
|
||||||
private extension TimelineViewController {
|
private extension MainTimelineViewController {
|
||||||
|
|
||||||
func configureToolbar() {
|
func configureToolbar() {
|
||||||
|
|
||||||
@ -617,7 +617,7 @@ private extension TimelineViewController {
|
|||||||
|
|
||||||
title = coordinator.timelineFeed?.nameForDisplay ?? "Timeline"
|
title = coordinator.timelineFeed?.nameForDisplay ?? "Timeline"
|
||||||
|
|
||||||
if let titleView = navigationItem.titleView as? TimelineTitleView {
|
if let titleView = navigationItem.titleView as? MainTimelineTitleView {
|
||||||
let timelineIconImage = coordinator.timelineIconImage
|
let timelineIconImage = coordinator.timelineIconImage
|
||||||
titleView.iconView.iconImage = timelineIconImage
|
titleView.iconView.iconImage = timelineIconImage
|
||||||
if let preferredColor = timelineIconImage?.preferredColor {
|
if let preferredColor = timelineIconImage?.preferredColor {
|
||||||
@ -688,7 +688,7 @@ private extension TimelineViewController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func updateTitleUnreadCount() {
|
func updateTitleUnreadCount() {
|
||||||
if let titleView = navigationItem.titleView as? TimelineTitleView {
|
if let titleView = navigationItem.titleView as? MainTimelineTitleView {
|
||||||
titleView.unreadCountView.unreadCount = coordinator.timelineUnreadCount
|
titleView.unreadCountView.unreadCount = coordinator.timelineUnreadCount
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -712,7 +712,7 @@ private extension TimelineViewController {
|
|||||||
|
|
||||||
func makeDataSource() -> UITableViewDiffableDataSource<Int, Article> {
|
func makeDataSource() -> UITableViewDiffableDataSource<Int, Article> {
|
||||||
let dataSource: UITableViewDiffableDataSource<Int, Article> =
|
let dataSource: UITableViewDiffableDataSource<Int, Article> =
|
||||||
TimelineDataSource(tableView: tableView, cellProvider: { [weak self] tableView, indexPath, article in
|
MainTimelineDataSource(tableView: tableView, cellProvider: { [weak self] tableView, indexPath, article in
|
||||||
let cell = tableView.dequeueReusableCell(withIdentifier: "Cell", for: indexPath) as! MainTimelineTableViewCell
|
let cell = tableView.dequeueReusableCell(withIdentifier: "Cell", for: indexPath) as! MainTimelineTableViewCell
|
||||||
self?.configure(cell, article: article)
|
self?.configure(cell, article: article)
|
||||||
return cell
|
return cell
|
@ -61,7 +61,7 @@ class SceneCoordinator: NSObject, UndoableCommandRunner {
|
|||||||
private var rootSplitViewController: RootSplitViewController!
|
private var rootSplitViewController: RootSplitViewController!
|
||||||
private var navigationController: UINavigationController!
|
private var navigationController: UINavigationController!
|
||||||
private var feedViewController: MainFeedViewController!
|
private var feedViewController: MainFeedViewController!
|
||||||
private var timelineViewController: TimelineViewController?
|
private var timelineViewController: MainTimelineViewController?
|
||||||
private var subSplitViewController: UISplitViewController?
|
private var subSplitViewController: UISplitViewController?
|
||||||
|
|
||||||
private var articleViewController: ArticleViewController? {
|
private var articleViewController: ArticleViewController? {
|
||||||
@ -825,7 +825,7 @@ class SceneCoordinator: NSObject, UndoableCommandRunner {
|
|||||||
self.rebuildBackingStores()
|
self.rebuildBackingStores()
|
||||||
}
|
}
|
||||||
self.activityManager.invalidateSelecting()
|
self.activityManager.invalidateSelecting()
|
||||||
if self.rootSplitViewController.isCollapsed && self.navControllerForTimeline().viewControllers.last is TimelineViewController {
|
if self.rootSplitViewController.isCollapsed && self.navControllerForTimeline().viewControllers.last is MainTimelineViewController {
|
||||||
self.navControllerForTimeline().popViewController(animated: animations.contains(.navigation))
|
self.navControllerForTimeline().popViewController(animated: animations.contains(.navigation))
|
||||||
}
|
}
|
||||||
completion?()
|
completion?()
|
||||||
@ -2099,9 +2099,9 @@ private extension SceneCoordinator {
|
|||||||
// MARK: Three Panel Mode
|
// MARK: Three Panel Mode
|
||||||
|
|
||||||
func installTimelineControllerIfNecessary(animated: Bool) {
|
func installTimelineControllerIfNecessary(animated: Bool) {
|
||||||
if navControllerForTimeline().viewControllers.filter({ $0 is TimelineViewController }).count < 1 {
|
if navControllerForTimeline().viewControllers.filter({ $0 is MainTimelineViewController }).count < 1 {
|
||||||
isTimelineViewControllerPending = true
|
isTimelineViewControllerPending = true
|
||||||
timelineViewController = UIStoryboard.main.instantiateController(ofType: TimelineViewController.self)
|
timelineViewController = UIStoryboard.main.instantiateController(ofType: MainTimelineViewController.self)
|
||||||
timelineViewController!.coordinator = self
|
timelineViewController!.coordinator = self
|
||||||
navControllerForTimeline().pushViewController(timelineViewController!, animated: animated)
|
navControllerForTimeline().pushViewController(timelineViewController!, animated: animated)
|
||||||
}
|
}
|
||||||
@ -2216,7 +2216,7 @@ private extension SceneCoordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if currentFeedIndexPath != nil {
|
if currentFeedIndexPath != nil {
|
||||||
timelineViewController = UIStoryboard.main.instantiateController(ofType: TimelineViewController.self)
|
timelineViewController = UIStoryboard.main.instantiateController(ofType: MainTimelineViewController.self)
|
||||||
timelineViewController!.coordinator = self
|
timelineViewController!.coordinator = self
|
||||||
navigationController.pushViewController(timelineViewController!, animated: false)
|
navigationController.pushViewController(timelineViewController!, animated: false)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user