diff --git a/Mac/Resources/Info.plist b/Mac/Resources/Info.plist
index 90970f567..a5e21c04c 100644
--- a/Mac/Resources/Info.plist
+++ b/Mac/Resources/Info.plist
@@ -62,7 +62,7 @@
NSAppleScriptEnabled
NSHumanReadableCopyright
- Copyright © 2002-2022 Brent Simmons. All rights reserved.
+ Copyright © 2002-2023 Brent Simmons. All rights reserved.
NSMainStoryboardFile
Main
NSPrincipalClass
diff --git a/Shared/ArticleStyles/ArticleThemesManager.swift b/Shared/ArticleStyles/ArticleThemesManager.swift
index 7a9685d47..d5c94875e 100644
--- a/Shared/ArticleStyles/ArticleThemesManager.swift
+++ b/Shared/ArticleStyles/ArticleThemesManager.swift
@@ -20,9 +20,7 @@ final class ArticleThemesManager: NSObject, NSFilePresenter, Logging {
public let folderPath: String
lazy var presentedItemOperationQueue = OperationQueue.main
- var presentedItemURL: URL? {
- return URL(fileURLWithPath: folderPath)
- }
+ var presentedItemURL: URL?
var currentThemeName: String {
get {
@@ -33,6 +31,7 @@ final class ArticleThemesManager: NSObject, NSFilePresenter, Logging {
do {
currentTheme = try articleThemeWithThemeName(newValue)
AppDefaults.shared.currentThemeName = newValue
+ updateFilePresenter()
} catch {
logger.error("Unable to set new theme: \(error.localizedDescription, privacy: .public)")
}
@@ -71,18 +70,22 @@ final class ArticleThemesManager: NSObject, NSFilePresenter, Logging {
assertionFailure("Could not create folder for Themes.")
abort()
}
-
- NSFileCoordinator.addFilePresenter(self)
+
+ #if os(macOS)
+ NotificationCenter.default.addObserver(self, selector: #selector(applicationDidBecomeActive(_:)), name: NSApplication.didBecomeActiveNotification, object: nil)
+ #else
+ NotificationCenter.default.addObserver(self, selector: #selector(applicationDidBecomeActive(_:)), name: UIApplication.didBecomeActiveNotification, object: nil)
+ #endif
+
+ updateFilePresenter()
}
func presentedSubitemDidChange(at url: URL) {
- if url.lastPathComponent.localizedCaseInsensitiveContains("nnwtheme") {
- themeNames = buildThemeNames()
- do {
- currentTheme = try articleThemeWithThemeName(currentThemeName)
- } catch {
- appDelegate.presentThemeImportError(error)
- }
+ themeNames = buildThemeNames()
+ do {
+ currentTheme = try articleThemeWithThemeName(currentThemeName)
+ } catch {
+ appDelegate.presentThemeImportError(error)
}
}
@@ -103,6 +106,8 @@ final class ArticleThemesManager: NSObject, NSFilePresenter, Logging {
}
try FileManager.default.copyItem(atPath: filename, toPath: toFilename)
+
+ themeNames = buildThemeNames()
}
func articleThemeWithThemeName(_ themeName: String) throws -> ArticleTheme {
@@ -128,6 +133,7 @@ final class ArticleThemesManager: NSObject, NSFilePresenter, Logging {
func deleteTheme(themeName: String) {
if let filename = pathForThemeName(themeName, folder: folderPath) {
try? FileManager.default.removeItem(atPath: filename)
+ themeNames = buildThemeNames()
}
}
@@ -136,6 +142,19 @@ final class ArticleThemesManager: NSObject, NSFilePresenter, Logging {
// MARK : Private
private extension ArticleThemesManager {
+
+ @objc func applicationDidBecomeActive(_ note: Notification) {
+ themeNames = buildThemeNames()
+ }
+
+ func updateFilePresenter() {
+ guard let currentThemePath = currentTheme.path else {
+ return
+ }
+ NSFileCoordinator.removeFilePresenter(self)
+ presentedItemURL = URL(fileURLWithPath: currentThemePath)
+ NSFileCoordinator.addFilePresenter(self)
+ }
func buildThemeNames() -> [String] {
let appThemeFilenames = Bundle.main.paths(forResourcesOfType: ArticleTheme.nnwThemeSuffix, inDirectory: nil)
diff --git a/iOS/MasterFeed/MasterFeedViewController.swift b/iOS/MasterFeed/MasterFeedViewController.swift
index 5734e061a..edf0ff532 100644
--- a/iOS/MasterFeed/MasterFeedViewController.swift
+++ b/iOS/MasterFeed/MasterFeedViewController.swift
@@ -695,7 +695,7 @@ class MasterFeedViewController: UITableViewController, UndoableCommandRunner, Ma
private func showTwitterDeprecationAlert() {
let alert = UIAlertController(title: NSLocalizedString("Twitter Integration Removed", comment: "Twitter Integration Removed"),
- message: NSLocalizedString("On February 1, 2023, Twitter announced the end of free access to the Twitter API, effective February 9.\n\nSince Twitter does not provide RSS feeds, we’ve had to use the Twitter API. Without free access to that API, we can’t read feeds from Twitter.\n\nWe’ve left your Twitter feeds intact. If you have any starred items from those feeds, they will remain as long as you don’t delete those feeds.\n\nYou can still read whatever you have already downloaded. However, those feeds will no longer update.", comment: "Twitter deprecation message"),
+ message: NSLocalizedString("Twitter has ended free access to the parts of the Twitter API that we need.\n\nSince Twitter does not provide RSS feeds, we’ve had to use the Twitter API. Without free access to that API, we can’t read feeds from Twitter.\n\nWe’ve left your Twitter feeds intact. If you have any starred items from those feeds, they will remain as long as you don’t delete those feeds.\n\nYou can still read whatever you have already downloaded. However, those feeds will no longer update.", comment: "Twitter deprecation message"),
preferredStyle: .alert)
alert.addAction(UIAlertAction(title: "OK", style: .cancel))
diff --git a/xcconfig/common/NetNewsWire_ios_target_common.xcconfig b/xcconfig/common/NetNewsWire_ios_target_common.xcconfig
index 6cc3d75cc..c290664ef 100644
--- a/xcconfig/common/NetNewsWire_ios_target_common.xcconfig
+++ b/xcconfig/common/NetNewsWire_ios_target_common.xcconfig
@@ -1,7 +1,7 @@
// High Level Settings common to both the iOS application and any extensions we bundle with it
MARKETING_VERSION = 6.1.1
-CURRENT_PROJECT_VERSION = 6114
+CURRENT_PROJECT_VERSION = 6115
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon