diff --git a/Mac/MainWindow/Timeline/TimelineViewController.swift b/Mac/MainWindow/Timeline/TimelineViewController.swift
index ef7e234ae..85620fcdb 100644
--- a/Mac/MainWindow/Timeline/TimelineViewController.swift
+++ b/Mac/MainWindow/Timeline/TimelineViewController.swift
@@ -845,7 +845,7 @@ final class TimelineViewController: NSViewController, UndoableCommandRunner, Unr
// After ArticleThumbnailFinder forgets its choices, which it does on this notification too.
Task { @MainActor in
remeasureRowsWhoseThumbnailChanged()
- // Thumbnails that couldn’t download while offline or in Low Data Mode try again.
+ // Thumbnails that couldn’t download while offline try again.
if ThumbnailDownloader.shared.networkAllowsDownloads {
reloadVisibleCells()
}
diff --git a/Modules/Images/Sources/Images/DownloadedImageCache.swift b/Modules/Images/Sources/Images/DownloadedImageCache.swift
index d2ba975f8..d446546ff 100644
--- a/Modules/Images/Sources/Images/DownloadedImageCache.swift
+++ b/Modules/Images/Sources/Images/DownloadedImageCache.swift
@@ -100,8 +100,13 @@ extension Notification.Name {
}
}
- /// False when offline or in Low Data Mode.
+ /// False when offline. Low Data Mode doesn’t stop thumbnail downloads.
static var networkAllowsDownloads: Bool {
+ NetworkMonitor.shared.isConnected
+ }
+
+ /// False when offline or in Low Data Mode.
+ static var networkAllowsRevalidation: Bool {
NetworkMonitor.shared.isConnected && !NetworkMonitor.shared.isConstrained
}
@@ -379,7 +384,7 @@ private extension DownloadedImageCache {
/// Doesn’t use the download queue, since icons aren’t limited either.
/// A network that doesn’t allow downloads, a retry wait, or a network error leaves `nextCheck` as is, so the next day’s use tries again.
func revalidateIfDue(_ url: String) async {
- guard Self.networkAllowsDownloads, !isWaitingToRetry(url) else {
+ guard Self.networkAllowsRevalidation, !isWaitingToRetry(url) else {
return
}
// Not <=, which is back-deployed and crashes on iOS 27.2 betas.
diff --git a/Shared/AppNotifications.swift b/Shared/AppNotifications.swift
index 647a3c4fe..2d281a8c1 100644
--- a/Shared/AppNotifications.swift
+++ b/Shared/AppNotifications.swift
@@ -14,6 +14,7 @@ extension Notification.Name {
static let UserDidAddFeed = Notification.Name("UserDidAddFeedNotification")
static let WebInspectorEnabledDidChange = Notification.Name("WebInspectorEnabledDidChange")
static let sidebarShowsIconsDidChange = Notification.Name("SidebarShowsIconsDidChangeNotification")
+ static let articleSwipeNavigationEnabledDidChange = Notification.Name("ArticleSwipeNavigationEnabledDidChangeNotification")
static let grayscaleIconsDidChange = Notification.Name("GrayscaleIconsDidChangeNotification")
static let sidebarSmartFeedsVisibilityDidChange = Notification.Name("SidebarSmartFeedsVisibilityDidChangeNotification")
static let timelineIconSizeDidChange = Notification.Name("TimelineIconSizeDidChangeNotification")
diff --git a/iOS/AppDefaults+iOS.swift b/iOS/AppDefaults+iOS.swift
index c1bc02e2c..8a7b66bb1 100644
--- a/iOS/AppDefaults+iOS.swift
+++ b/iOS/AppDefaults+iOS.swift
@@ -19,6 +19,7 @@ extension AppDefaults.Key {
static let articleFullscreenEnabled = "articleFullscreenEnabled"
static let confirmMarkAllAsRead = "confirmMarkAllAsRead"
static let showPreviewInTimelineContextMenu = "showPreviewInTimelineContextMenu"
+ static let articleSwipeNavigationEnabled = "articleSwipeNavigationEnabled"
static let lastRefresh = "lastRefresh"
static let useSystemBrowser = "useSystemBrowser"
static let hideReadFeeds = "hideReadFeeds"
@@ -120,6 +121,16 @@ extension AppDefaults {
}
}
+ static var articleSwipeNavigationEnabled: Bool {
+ get {
+ UserDefaults.standard.bool(forKey: Key.articleSwipeNavigationEnabled)
+ }
+ set {
+ UserDefaults.standard.set(newValue, forKey: Key.articleSwipeNavigationEnabled)
+ NotificationCenter.default.post(name: .articleSwipeNavigationEnabledDidChange, object: nil)
+ }
+ }
+
static var splitViewPreferredDisplayMode: Int {
get {
UserDefaults.standard.integer(forKey: Key.splitViewPreferredDisplayMode)
@@ -298,6 +309,7 @@ extension AppDefaults {
Key.articleFullscreenEnabled: false,
Key.confirmMarkAllAsRead: true,
Key.showPreviewInTimelineContextMenu: false,
+ Key.articleSwipeNavigationEnabled: true,
Key.splitViewPreferredDisplayMode: UISplitViewController.DisplayMode.oneBesideSecondary.rawValue
]
diff --git a/iOS/AppDelegate.swift b/iOS/AppDelegate.swift
index b4405e858..e00246afc 100644
--- a/iOS/AppDelegate.swift
+++ b/iOS/AppDelegate.swift
@@ -71,6 +71,7 @@ import Images
let isFirstRun = AppDefaults.isFirstRun
if isFirstRun {
Self.logger.info("Is first run.")
+ AppDefaults.articleSwipeNavigationEnabled = false
}
if isFirstRun && !AccountManager.shared.anyAccountHasAtLeastOneFeed() {
diff --git a/iOS/Article/ArticleViewController.swift b/iOS/Article/ArticleViewController.swift
index d47247f99..87c19db59 100644
--- a/iOS/Article/ArticleViewController.swift
+++ b/iOS/Article/ArticleViewController.swift
@@ -130,6 +130,7 @@ final class ArticleViewController: UIViewController {
NotificationCenter.default.addObserver(self, selector: #selector(unreadCountDidChange(_:)), name: .UnreadCountDidChange, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(statusesDidChange(_:)), name: .StatusesDidChange, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(contentSizeCategoryDidChange(_:)), name: UIContentSizeCategory.didChangeNotification, object: nil)
+ NotificationCenter.default.addObserver(self, selector: #selector(handleArticleSwipeNavigationEnabledDidChange(_:)), name: .articleSwipeNavigationEnabledDidChange, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(willEnterForeground(_:)), name: UIApplication.willEnterForegroundNotification, object: nil)
let appearance = UINavigationBarAppearance()
@@ -185,7 +186,7 @@ final class ArticleViewController: UIViewController {
pageViewController = UIPageViewController(transitionStyle: .scroll, navigationOrientation: .horizontal, options: [:])
pageViewController.delegate = self
- pageViewController.dataSource = self
+ updatePageViewControllerDataSource()
// This code is to disallow paging if we scroll from the left edge. If this code is removed
// PoppableGestureRecognizerDelegate will allow us to both navigate back and page back at the
@@ -350,6 +351,15 @@ final class ArticleViewController: UIViewController {
currentWebViewController?.fullReload()
}
+ @objc func handleArticleSwipeNavigationEnabledDidChange(_ notification: Notification) {
+ updatePageViewControllerDataSource()
+ }
+
+ /// A nil data source turns off swipe paging. `setViewControllers` still works.
+ func updatePageViewControllerDataSource() {
+ pageViewController.dataSource = AppDefaults.articleSwipeNavigationEnabled ? self : nil
+ }
+
@objc func willEnterForeground(_ note: Notification) {
// The toolbar will come back on you if you don't hide it again
if AppDefaults.logicalArticleFullscreenEnabled {
diff --git a/iOS/MainTimeline/MainTimelineViewController.swift b/iOS/MainTimeline/MainTimelineViewController.swift
index ba4404cb3..9e86e5455 100644
--- a/iOS/MainTimeline/MainTimelineViewController.swift
+++ b/iOS/MainTimeline/MainTimelineViewController.swift
@@ -1255,7 +1255,7 @@ private extension MainTimelineViewController {
guard thumbnailMode != nil, ThumbnailDownloader.shared.networkAllowsDownloads else {
return
}
- // Thumbnails that couldn’t download while offline or in Low Data Mode try again.
+ // Thumbnails that couldn’t download while offline try again.
reloadVisibleCells()
}
diff --git a/iOS/Settings/Settings.storyboard b/iOS/Settings/Settings.storyboard
index 406a9b913..99603c5dc 100644
--- a/iOS/Settings/Settings.storyboard
+++ b/iOS/Settings/Settings.storyboard
@@ -552,6 +552,40 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -875,6 +909,7 @@
+
diff --git a/iOS/Settings/SettingsViewController.swift b/iOS/Settings/SettingsViewController.swift
index 604d55e74..f34d57136 100644
--- a/iOS/Settings/SettingsViewController.swift
+++ b/iOS/Settings/SettingsViewController.swift
@@ -56,7 +56,8 @@ final class SettingsViewController: UITableViewController {
case theme = 0
case openLinksInNetNewsWire = 1
case enableJavaScript = 2
- case enableFullScreenArticles = 3
+ case swipeToNextPreviousArticle = 3
+ case enableFullScreenArticles = 4
}
private enum HelpRow: Int {
@@ -80,6 +81,7 @@ final class SettingsViewController: UITableViewController {
@IBOutlet var unreadCountDisplayCell: UITableViewCell?
@IBOutlet var openLinksInNetNewsWire: UISwitch!
@IBOutlet var enableJavaScriptSwitch: UISwitch!
+ @IBOutlet var swipeToNextPreviousArticleSwitch: UISwitch?
@IBOutlet var sidebarShowsIconsSwitch: UISwitch?
@IBOutlet var grayscaleIconsSwitch: UISwitch?
@IBOutlet var showTodayFeedSwitch: UISwitch?
@@ -151,6 +153,7 @@ final class SettingsViewController: UITableViewController {
}
showPreviewInTimelineContextMenuSwitch?.isOn = AppDefaults.showPreviewInTimelineContextMenu
+ swipeToNextPreviousArticleSwitch?.isOn = AppDefaults.articleSwipeNavigationEnabled
if AppDefaults.articleFullscreenAvailable {
showFullscreenArticlesSwitch.isOn = true
@@ -448,6 +451,10 @@ final class SettingsViewController: UITableViewController {
}
}
+ @IBAction func switchSwipeToNextPreviousArticle(_ sender: UISwitch) {
+ AppDefaults.articleSwipeNavigationEnabled = sender.isOn
+ }
+
@IBAction func switchJavaScriptPreference(_ sender: Any) {
AppDefaults.isArticleContentJavascriptEnabled = enableJavaScriptSwitch.isOn
}