Move sidebar settings to separate section.

This commit is contained in:
Brent Simmons committed 2026-11-14 10:33:28 -08:00
1 parent 96e06cb851
commit ff52900504
4 files changed
+159 -190

No files matched your search

+15
View File
@@ -1263,12 +1263,18 @@
"Show" : {
"comment" : "Show"
},
"Show All Unread" : {
"comment" : "Show All Unread"
},
"Show dot" : {
"comment" : "Unread Counts setting: show a dot instead of the number of unread articles"
},
"Show Feed Article" : {
"comment" : "Show Feed Article"
},
"Show Feed Icons" : {
"comment" : "Show Feed Icons"
},
"Show feeds that haven’t updated in…" : {
"comment" : "Show stale feeds text"
},
@@ -1287,12 +1293,18 @@
"Show Sidebar" : {
"comment" : "Command"
},
"Show Starred" : {
"comment" : "Show Starred"
},
"Show Status Bar" : {
"comment" : "Command"
},
"Show Theme Menu in Status Bar" : {
"comment" : "Command"
},
"Show Today" : {
"comment" : "Show Today"
},
"Show Website" : {
"comment" : "Show Website"
},
@@ -1302,6 +1314,9 @@
"Shows the whole title, up to %d lines." : {
"comment" : "Timeline Layout: explains the Full Title, No Preview choice"
},
"Sidebar" : {
"comment" : "Sidebar"
},
"Sign in to your BazQux account and sync your feeds across your devices. Your username and password will be encrypted and stored in Keychain.\n\nDon’t have a BazQux account?" : {
"comment" : "BazQux"
},
+17 -140
View File
@@ -115,142 +115,6 @@
</tableViewCell>
</cells>
</tableViewSection>
<tableViewSection headerTitle="Sidebar" id="tFI-AQ-Umj">
<cells>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="none" indentationWidth="10" id="w3Y-p9-z8p" customClass="VibrantTableViewCell" customModule="NetNewsWire" customModuleProvider="target">
<rect key="frame" x="20" y="478.5" width="374" height="51.5"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="w3Y-p9-z8p" id="1sW-x1-YOA">
<rect key="frame" x="0.0" y="0.0" width="374" height="51.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" horizontalCompressionResistancePriority="250" text="Show Feed Icons" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontForContentSizeCategory="YES" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="tKT-7c-dVn" customClass="VibrantLabel" customModule="NetNewsWire" customModuleProvider="target">
<rect key="frame" x="20" y="15" width="167.5" height="21.5"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleBody"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="ty7-nO-vmW">
<rect key="frame" x="293" y="12" width="63" height="28"/>
<color key="onTintColor" name="primaryAccentColor"/>
<connections>
<action selector="switchSidebarShowsIcons:" destination="a0p-rk-skQ" eventType="valueChanged" id="mhE-9m-RdD"/>
</connections>
</switch>
</subviews>
<constraints>
<constraint firstItem="ty7-nO-vmW" firstAttribute="top" relation="greaterThanOrEqual" secondItem="1sW-x1-YOA" secondAttribute="top" constant="6" id="7ZX-Iu-TtD"/>
<constraint firstItem="ty7-nO-vmW" firstAttribute="centerY" secondItem="1sW-x1-YOA" secondAttribute="centerY" id="Mr5-mQ-hD3"/>
<constraint firstItem="tKT-7c-dVn" firstAttribute="top" secondItem="1sW-x1-YOA" secondAttribute="topMargin" id="Euu-QJ-bwj"/>
<constraint firstAttribute="bottomMargin" secondItem="tKT-7c-dVn" secondAttribute="bottom" id="dXi-Xs-qSm"/>
<constraint firstAttribute="trailingMargin" secondItem="ty7-nO-vmW" secondAttribute="trailing" id="GSC-py-hGF"/>
<constraint firstItem="ty7-nO-vmW" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="tKT-7c-dVn" secondAttribute="trailing" constant="8" id="Qgp-cW-13e"/>
<constraint firstItem="tKT-7c-dVn" firstAttribute="leading" secondItem="1sW-x1-YOA" secondAttribute="leadingMargin" id="mb5-hb-ywG"/>
<constraint firstAttribute="bottom" relation="greaterThanOrEqual" secondItem="ty7-nO-vmW" secondAttribute="bottom" constant="6" id="pI7-WU-JTs"/>
</constraints>
</tableViewCellContentView>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="none" indentationWidth="10" id="XzU-su-jtR" customClass="VibrantTableViewCell" customModule="NetNewsWire" customModuleProvider="target">
<rect key="frame" x="20" y="478.5" width="374" height="51.5"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="XzU-su-jtR" id="A93-Ke-f35">
<rect key="frame" x="0.0" y="0.0" width="374" height="51.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" horizontalCompressionResistancePriority="250" text="Show Today" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontForContentSizeCategory="YES" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="xuJ-O0-rTz" customClass="VibrantLabel" customModule="NetNewsWire" customModuleProvider="target">
<rect key="frame" x="20" y="15" width="167.5" height="21.5"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleBody"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="L79-sq-qjg">
<rect key="frame" x="293" y="12" width="63" height="28"/>
<color key="onTintColor" name="primaryAccentColor"/>
<connections>
<action selector="switchShowTodayFeed:" destination="a0p-rk-skQ" eventType="valueChanged" id="pUc-rE-sgg"/>
</connections>
</switch>
</subviews>
<constraints>
<constraint firstItem="L79-sq-qjg" firstAttribute="top" relation="greaterThanOrEqual" secondItem="A93-Ke-f35" secondAttribute="top" constant="6" id="gH3-Rx-GIJ"/>
<constraint firstItem="L79-sq-qjg" firstAttribute="centerY" secondItem="A93-Ke-f35" secondAttribute="centerY" id="pbF-vA-e6s"/>
<constraint firstItem="xuJ-O0-rTz" firstAttribute="top" secondItem="A93-Ke-f35" secondAttribute="topMargin" id="HLd-qF-Izz"/>
<constraint firstAttribute="bottomMargin" secondItem="xuJ-O0-rTz" secondAttribute="bottom" id="dPF-SE-5RX"/>
<constraint firstAttribute="trailingMargin" secondItem="L79-sq-qjg" secondAttribute="trailing" id="J1W-di-Xap"/>
<constraint firstItem="L79-sq-qjg" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="xuJ-O0-rTz" secondAttribute="trailing" constant="8" id="Cdp-Mp-AxH"/>
<constraint firstItem="xuJ-O0-rTz" firstAttribute="leading" secondItem="A93-Ke-f35" secondAttribute="leadingMargin" id="uu8-2W-pFH"/>
<constraint firstAttribute="bottom" relation="greaterThanOrEqual" secondItem="L79-sq-qjg" secondAttribute="bottom" constant="6" id="yWw-kP-IPN"/>
</constraints>
</tableViewCellContentView>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="none" indentationWidth="10" id="xJ6-yt-1ke" customClass="VibrantTableViewCell" customModule="NetNewsWire" customModuleProvider="target">
<rect key="frame" x="20" y="478.5" width="374" height="51.5"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="xJ6-yt-1ke" id="Z6K-9E-H8e">
<rect key="frame" x="0.0" y="0.0" width="374" height="51.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" horizontalCompressionResistancePriority="250" text="Show All Unread" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontForContentSizeCategory="YES" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="uxx-Ik-kis" customClass="VibrantLabel" customModule="NetNewsWire" customModuleProvider="target">
<rect key="frame" x="20" y="15" width="167.5" height="21.5"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleBody"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="0HY-pc-41T">
<rect key="frame" x="293" y="12" width="63" height="28"/>
<color key="onTintColor" name="primaryAccentColor"/>
<connections>
<action selector="switchShowUnreadFeed:" destination="a0p-rk-skQ" eventType="valueChanged" id="GWv-Xd-Mye"/>
</connections>
</switch>
</subviews>
<constraints>
<constraint firstItem="0HY-pc-41T" firstAttribute="top" relation="greaterThanOrEqual" secondItem="Z6K-9E-H8e" secondAttribute="top" constant="6" id="F2p-4p-Ydp"/>
<constraint firstItem="0HY-pc-41T" firstAttribute="centerY" secondItem="Z6K-9E-H8e" secondAttribute="centerY" id="GTa-dD-jXp"/>
<constraint firstItem="uxx-Ik-kis" firstAttribute="top" secondItem="Z6K-9E-H8e" secondAttribute="topMargin" id="oGs-zl-7Eg"/>
<constraint firstAttribute="bottomMargin" secondItem="uxx-Ik-kis" secondAttribute="bottom" id="GIS-3x-yIW"/>
<constraint firstAttribute="trailingMargin" secondItem="0HY-pc-41T" secondAttribute="trailing" id="9QX-h2-2mR"/>
<constraint firstItem="0HY-pc-41T" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="uxx-Ik-kis" secondAttribute="trailing" constant="8" id="8J5-SO-kuX"/>
<constraint firstItem="uxx-Ik-kis" firstAttribute="leading" secondItem="Z6K-9E-H8e" secondAttribute="leadingMargin" id="qoh-9L-fV1"/>
<constraint firstAttribute="bottom" relation="greaterThanOrEqual" secondItem="0HY-pc-41T" secondAttribute="bottom" constant="6" id="u5F-dc-C3H"/>
</constraints>
</tableViewCellContentView>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="none" indentationWidth="10" id="tFn-Al-LvI" customClass="VibrantTableViewCell" customModule="NetNewsWire" customModuleProvider="target">
<rect key="frame" x="20" y="478.5" width="374" height="51.5"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="tFn-Al-LvI" id="r7N-Jb-Z0m">
<rect key="frame" x="0.0" y="0.0" width="374" height="51.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" horizontalCompressionResistancePriority="250" text="Show Starred" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontForContentSizeCategory="YES" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="9gx-mR-jWA" customClass="VibrantLabel" customModule="NetNewsWire" customModuleProvider="target">
<rect key="frame" x="20" y="15" width="167.5" height="21.5"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleBody"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="lSd-Rw-EZx">
<rect key="frame" x="293" y="12" width="63" height="28"/>
<color key="onTintColor" name="primaryAccentColor"/>
<connections>
<action selector="switchShowStarredFeed:" destination="a0p-rk-skQ" eventType="valueChanged" id="sFF-QN-8vL"/>
</connections>
</switch>
</subviews>
<constraints>
<constraint firstItem="lSd-Rw-EZx" firstAttribute="top" relation="greaterThanOrEqual" secondItem="r7N-Jb-Z0m" secondAttribute="top" constant="6" id="uNX-ge-EE7"/>
<constraint firstItem="lSd-Rw-EZx" firstAttribute="centerY" secondItem="r7N-Jb-Z0m" secondAttribute="centerY" id="Yho-pX-kqu"/>
<constraint firstItem="9gx-mR-jWA" firstAttribute="top" secondItem="r7N-Jb-Z0m" secondAttribute="topMargin" id="zfs-n3-lpp"/>
<constraint firstAttribute="bottomMargin" secondItem="9gx-mR-jWA" secondAttribute="bottom" id="Nb0-zM-hjC"/>
<constraint firstAttribute="trailingMargin" secondItem="lSd-Rw-EZx" secondAttribute="trailing" id="ETj-Ga-9Ui"/>
<constraint firstItem="lSd-Rw-EZx" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="9gx-mR-jWA" secondAttribute="trailing" constant="8" id="S1s-3A-WpJ"/>
<constraint firstItem="9gx-mR-jWA" firstAttribute="leading" secondItem="r7N-Jb-Z0m" secondAttribute="leadingMargin" id="2pR-BU-L0P"/>
<constraint firstAttribute="bottom" relation="greaterThanOrEqual" secondItem="lSd-Rw-EZx" secondAttribute="bottom" constant="6" id="2FZ-Fm-qI2"/>
</constraints>
</tableViewCellContentView>
</tableViewCell>
</cells>
</tableViewSection>
<tableViewSection headerTitle="Timeline" id="9Pk-Y8-JVJ">
<cells>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="none" indentationWidth="10" id="MpA-w1-Wwh" customClass="VibrantTableViewCell" customModule="NetNewsWire" customModuleProvider="target">
@@ -631,6 +495,23 @@
</tableViewSection>
<tableViewSection id="Trb-eL-9xZ">
<cells>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" textLabel="Sdb-lb-4bR" style="IBUITableViewCellStyleDefault" id="Sdb-Cel-7rY" customClass="VibrantTableViewCell" customModule="NetNewsWire" customModuleProvider="target">
<rect key="frame" x="20" y="1157" width="374" height="51"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="Sdb-Cel-7rY" id="Sdb-Cnt-2mN">
<rect key="frame" x="0.0" y="0.0" width="343.5" height="51"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" insetsLayoutMarginsFromSafeArea="NO" text="Sidebar" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontForContentSizeCategory="YES" adjustsFontSizeToFit="NO" id="Sdb-lb-4bR">
<rect key="frame" x="20" y="0.0" width="315.5" height="51"/>
<autoresizingMask key="autoresizingMask"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleBody"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</tableViewCellContentView>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" textLabel="Apr-lb-4bR" style="IBUITableViewCellStyleDefault" id="Apr-Cel-7rY" customClass="VibrantTableViewCell" customModule="NetNewsWire" customModuleProvider="target">
<rect key="frame" x="20" y="1208" width="374" height="51"/>
<autoresizingMask key="autoresizingMask"/>
@@ -707,10 +588,6 @@
<outlet property="openLinksInNetNewsWire" destination="dhR-L2-PX3" id="z1b-pX-bwG"/>
<outlet property="refreshClearsReadArticlesSwitch" destination="duV-CN-JmH" id="xTd-jF-Ei1"/>
<outlet property="showFullscreenArticlesSwitch" destination="2Md-2E-7Z4" id="lEN-VP-wEO"/>
<outlet property="showStarredFeedSwitch" destination="lSd-Rw-EZx" id="IuB-bq-EPY"/>
<outlet property="showTodayFeedSwitch" destination="L79-sq-qjg" id="MPp-zd-KpY"/>
<outlet property="showUnreadFeedSwitch" destination="0HY-pc-41T" id="xEp-Pv-G2k"/>
<outlet property="sidebarShowsIconsSwitch" destination="ty7-nO-vmW" id="ODo-qY-xMD"/>
<outlet property="timelineSortOrderSwitch" destination="Keq-Np-l9O" id="Zm7-HG-r5h"/>
</connections>
</tableViewController>
+9 -50
View File
@@ -20,16 +20,16 @@ final class SettingsViewController: UITableViewController {
case notifications = 0
case accounts = 1
case feeds = 2
case sidebar = 3
case timeline = 4
case articles = 5
case moreScreens = 6
case timeline = 3
case articles = 4
case moreScreens = 5
}
private enum MoreScreensRow: Int {
case appearance = 0
case troubleshooting = 1
case help = 2
case sidebar = 0
case appearance = 1
case troubleshooting = 2
case help = 3
}
private enum FeedsRow: Int {
@@ -67,10 +67,6 @@ final class SettingsViewController: UITableViewController {
@IBOutlet var openLinksInNetNewsWire: UISwitch!
@IBOutlet var enableJavaScriptSwitch: UISwitch!
@IBOutlet var swipeToNextPreviousArticleSwitch: UISwitch?
@IBOutlet var sidebarShowsIconsSwitch: UISwitch?
@IBOutlet var showTodayFeedSwitch: UISwitch?
@IBOutlet var showUnreadFeedSwitch: UISwitch?
@IBOutlet var showStarredFeedSwitch: UISwitch?
var scrollToArticlesSection = false
weak var presentingParentController: UIViewController?
@@ -83,17 +79,12 @@ final class SettingsViewController: UITableViewController {
NotificationCenter.default.addObserver(self, selector: #selector(accountsDidChange), name: .UserDidAddAccount, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(accountsDidChange), name: .UserDidDeleteAccount, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(displayNameDidChange), name: .DisplayNameDidChange, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(handleSidebarShowsIconsDidChange(_:)), name: .sidebarShowsIconsDidChange, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(handleSidebarSmartFeedsVisibilityDidChange(_:)), name: .sidebarSmartFeedsVisibilityDidChange, object: nil)
tableView.register(UINib(nibName: "SettingsComboTableViewCell", bundle: nil), forCellReuseIdentifier: "SettingsComboTableViewCell")
tableView.register(UINib(nibName: "SettingsTableViewCell", bundle: nil), forCellReuseIdentifier: "SettingsTableViewCell")
tableView.rowHeight = UITableView.automaticDimension
tableView.estimatedRowHeight = 44
updateSidebarShowsIconsSwitch()
updateSmartFeedsSwitches()
}
override func viewWillAppear(_ animated: Bool) {
@@ -268,6 +259,8 @@ final class SettingsViewController: UITableViewController {
}
case .moreScreens:
switch MoreScreensRow(rawValue: indexPath.row) {
case .sidebar:
self.navigationController?.pushViewController(SidebarSettingsViewController(), animated: true)
case .appearance:
self.navigationController?.pushViewController(AppearanceSettingsViewController(), animated: true)
case .troubleshooting:
@@ -310,22 +303,6 @@ final class SettingsViewController: UITableViewController {
dismiss(animated: true)
}
@IBAction func switchSidebarShowsIcons(_ sender: UISwitch) {
AppDefaults.sidebarShowsIcons = sender.isOn
}
@IBAction func switchShowTodayFeed(_ sender: UISwitch) {
AppDefaults.showTodayFeed = sender.isOn
}
@IBAction func switchShowUnreadFeed(_ sender: UISwitch) {
AppDefaults.showUnreadFeed = sender.isOn
}
@IBAction func switchShowStarredFeed(_ sender: UISwitch) {
AppDefaults.showStarredFeed = sender.isOn
}
@IBAction func switchTimelineOrder(_ sender: Any) {
if timelineSortOrderSwitch.isOn {
AppDefaults.timelineSortDirection = .orderedAscending
@@ -404,14 +381,6 @@ final class SettingsViewController: UITableViewController {
tableView.reloadData()
}
@objc func handleSidebarShowsIconsDidChange(_ notification: Notification) {
updateSidebarShowsIconsSwitch()
}
@objc func handleSidebarSmartFeedsVisibilityDidChange(_ notification: Notification) {
updateSmartFeedsSwitches()
}
}
// MARK: - OPML Document Picker
@@ -439,16 +408,6 @@ extension SettingsViewController: UIDocumentPickerDelegate {
private extension SettingsViewController {
func updateSidebarShowsIconsSwitch() {
sidebarShowsIconsSwitch?.isOn = AppDefaults.sidebarShowsIcons
}
func updateSmartFeedsSwitches() {
showTodayFeedSwitch?.isOn = AppDefaults.showTodayFeed
showUnreadFeedSwitch?.isOn = AppDefaults.showUnreadFeed
showStarredFeedSwitch?.isOn = AppDefaults.showStarredFeed
}
func addFeed() {
self.dismiss(animated: true)
@@ -0,0 +1,118 @@
//
// SidebarSettingsViewController.swift
// NetNewsWire-iOS
//
// Created by Brent Simmons on 11/15/26.
// Copyright © 2026 Ranchero Software. All rights reserved.
//
import UIKit
final class SidebarSettingsViewController: UITableViewController {
private enum Row: Int, CaseIterable {
case showFeedIcons
case showToday
case showAllUnread
case showStarred
}
private let showFeedIconsSwitch = UISwitch()
private let showTodaySwitch = UISwitch()
private let showAllUnreadSwitch = UISwitch()
private let showStarredSwitch = UISwitch()
private var cells = [UITableViewCell]()
init() {
super.init(style: .insetGrouped)
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
override func viewDidLoad() {
super.viewDidLoad()
title = NSLocalizedString("Sidebar", comment: "Sidebar")
NotificationCenter.default.addObserver(self, selector: #selector(handleSidebarShowsIconsDidChange(_:)), name: .sidebarShowsIconsDidChange, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(handleSidebarSmartFeedsVisibilityDidChange(_:)), name: .sidebarSmartFeedsVisibilityDidChange, object: nil)
let switchesAndTitles: [(UISwitch, String, Selector)] = [
(showFeedIconsSwitch, NSLocalizedString("Show Feed Icons", comment: "Show Feed Icons"), #selector(switchShowFeedIcons(_:))),
(showTodaySwitch, NSLocalizedString("Show Today", comment: "Show Today"), #selector(switchShowToday(_:))),
(showAllUnreadSwitch, NSLocalizedString("Show All Unread", comment: "Show All Unread"), #selector(switchShowAllUnread(_:))),
(showStarredSwitch, NSLocalizedString("Show Starred", comment: "Show Starred"), #selector(switchShowStarred(_:)))
]
cells = switchesAndTitles.map { makeCell(switch: $0.0, title: $0.1, action: $0.2) }
updateShowFeedIconsSwitch()
updateSmartFeedsSwitches()
}
// MARK: - UITableViewDataSource
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return cells.count
}
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
return cells[indexPath.row]
}
// MARK: - Actions
@objc func switchShowFeedIcons(_ sender: UISwitch) {
AppDefaults.sidebarShowsIcons = sender.isOn
}
@objc func switchShowToday(_ sender: UISwitch) {
AppDefaults.showTodayFeed = sender.isOn
}
@objc func switchShowAllUnread(_ sender: UISwitch) {
AppDefaults.showUnreadFeed = sender.isOn
}
@objc func switchShowStarred(_ sender: UISwitch) {
AppDefaults.showStarredFeed = sender.isOn
}
// MARK: - Notifications
@objc func handleSidebarShowsIconsDidChange(_ notification: Notification) {
updateShowFeedIconsSwitch()
}
@objc func handleSidebarSmartFeedsVisibilityDidChange(_ notification: Notification) {
updateSmartFeedsSwitches()
}
}
// MARK: - Private
private extension SidebarSettingsViewController {
func makeCell(switch toggle: UISwitch, title: String, action: Selector) -> UITableViewCell {
let cell = VibrantTableViewCell(style: .default, reuseIdentifier: nil)
cell.selectionStyle = .none
cell.textLabel?.text = title
cell.textLabel?.numberOfLines = 0
cell.textLabel?.adjustsFontForContentSizeCategory = true
toggle.onTintColor = Assets.Colors.primaryAccent
toggle.addTarget(self, action: action, for: .valueChanged)
cell.accessoryView = toggle
return cell
}
func updateShowFeedIconsSwitch() {
showFeedIconsSwitch.isOn = AppDefaults.sidebarShowsIcons
}
func updateSmartFeedsSwitches() {
showTodaySwitch.isOn = AppDefaults.showTodayFeed
showAllUnreadSwitch.isOn = AppDefaults.showUnreadFeed
showStarredSwitch.isOn = AppDefaults.showStarredFeed
}
}