From e2eeed8f995d4a9f057f507bcb2448df54a101eb Mon Sep 17 00:00:00 2001 From: Stuart Breckenridge Date: Tue, 30 May 2023 09:15:08 +0800 Subject: [PATCH 1/2] Target macOS 13 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • `xcconfig` `MACOSX_DEPLOYMENT_TARGET` updated to 13.0 • Removed `@available` annotations for macOS < 13.0 • Removed for Big Sur fixes. This has been built and doesn’t trigger any build settings should be `xcconfig` options. --- Mac/MainWindow/About/AboutHTML.swift | 1 - .../About/AboutNewNewsWireView.swift | 4 +- .../About/AboutWindowController.swift | 2 - Mac/MainWindow/Detail/DetailWebView.swift | 41 ------------------- Shared/AboutData.swift | 3 -- xcconfig/NetNewsWire_project.xcconfig | 2 +- .../NetNewsWire_mac_target_common.xcconfig | 2 +- 7 files changed, 3 insertions(+), 52 deletions(-) diff --git a/Mac/MainWindow/About/AboutHTML.swift b/Mac/MainWindow/About/AboutHTML.swift index 1c5cd0433..f5317f55c 100644 --- a/Mac/MainWindow/About/AboutHTML.swift +++ b/Mac/MainWindow/About/AboutHTML.swift @@ -8,7 +8,6 @@ import Html -@available(macOS 12, *) struct AboutHTML: LoadableAboutData { private func stylesheet() -> StaticString { diff --git a/Mac/MainWindow/About/AboutNewNewsWireView.swift b/Mac/MainWindow/About/AboutNewNewsWireView.swift index 30bcb9e18..97efaa071 100644 --- a/Mac/MainWindow/About/AboutNewNewsWireView.swift +++ b/Mac/MainWindow/About/AboutNewNewsWireView.swift @@ -10,7 +10,6 @@ import SwiftUI import WebKit import Html -@available(macOS 12, *) fileprivate struct WebView: NSViewRepresentable { var htmlString: String @@ -50,7 +49,6 @@ fileprivate struct WebView: NSViewRepresentable { } } -@available(macOS 12, *) struct AboutNewNewsWireView: View, LoadableAboutData { var body: some View { VStack(spacing: 4) { @@ -85,7 +83,7 @@ struct AboutNewNewsWireView: View, LoadableAboutData { } } -@available(macOS 12, *) + struct AboutNetNewsWireView_Previews: PreviewProvider { static var previews: some View { AboutNewNewsWireView() diff --git a/Mac/MainWindow/About/AboutWindowController.swift b/Mac/MainWindow/About/AboutWindowController.swift index 341408dfd..52801fefd 100644 --- a/Mac/MainWindow/About/AboutWindowController.swift +++ b/Mac/MainWindow/About/AboutWindowController.swift @@ -16,7 +16,6 @@ extension NSUserInterfaceItemIdentifier { // MARK: - AboutWindowController -@available(macOS 12, *) class AboutWindowController: NSWindowController { var hostingController: AboutHostingController @@ -44,7 +43,6 @@ class AboutWindowController: NSWindowController { // MARK: - AboutHostingController -@available(macOS 12, *) class AboutHostingController: NSHostingController { override init(rootView: AnyView) { diff --git a/Mac/MainWindow/Detail/DetailWebView.swift b/Mac/MainWindow/Detail/DetailWebView.swift index dd793dd23..974a3bafd 100644 --- a/Mac/MainWindow/Detail/DetailWebView.swift +++ b/Mac/MainWindow/Detail/DetailWebView.swift @@ -53,51 +53,10 @@ import RSCore override func viewDidEndLiveResize() { super.viewDidEndLiveResize() evaluateJavaScript("document.body.style.overflow = 'visible';", completionHandler: nil) - bigSurOffsetFix() } override func setFrameSize(_ newSize: NSSize) { super.setFrameSize(newSize) - if (!inLiveResize) { - bigSurOffsetFix() - } - } - - private var inBigSurOffsetFix = false - - @available(macOS, obsoleted: 12, message: "when minimum deployment > macOS 11 remove bigSurOffsetFix() and calls to it.") - private func bigSurOffsetFix() { - /* - On macOS 11, when a user exits full screen - or exits zoomed mode by disconnecting an external display - the webview's `origin.y` is offset by a sizeable amount. - - This code adjusts the height of the window by -1pt/+1pt, - which puts the webview back in the correct place. - - This code is only executed if currently running on macOS 11 - */ - - if #unavailable(macOS 12) { - guard var frame = window?.frame else { - return - } - - guard !inBigSurOffsetFix else { - return - } - - inBigSurOffsetFix = true - - defer { - inBigSurOffsetFix = false - } - - frame.size = NSSize(width: window!.frame.width, height: window!.frame.height - 1) - window!.setFrame(frame, display: false) - frame.size = NSSize(width: frame.width, height: frame.height + 1) - window!.setFrame(frame, display: false) - } } // MARK: NSTextFinderClient diff --git a/Shared/AboutData.swift b/Shared/AboutData.swift index 4e76aa141..03e0cc95a 100644 --- a/Shared/AboutData.swift +++ b/Shared/AboutData.swift @@ -9,13 +9,11 @@ import Foundation @available(iOS 15, *) -@available(macOS 12, *) protocol LoadableAboutData { var about: AboutData { get } } @available(iOS 15, *) -@available(macOS 12, *) extension LoadableAboutData { var about: AboutData { @@ -30,7 +28,6 @@ extension LoadableAboutData { } @available(iOS 15, *) -@available(macOS 12, *) struct AboutData: Codable { var PrimaryContributors: [Contributor] var AdditionalContributors: [Contributor] diff --git a/xcconfig/NetNewsWire_project.xcconfig b/xcconfig/NetNewsWire_project.xcconfig index 40588ba58..e838801a9 100644 --- a/xcconfig/NetNewsWire_project.xcconfig +++ b/xcconfig/NetNewsWire_project.xcconfig @@ -40,7 +40,7 @@ GCC_WARN_UNDECLARED_SELECTOR = YES GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE GCC_WARN_UNUSED_FUNCTION = YES GCC_WARN_UNUSED_VARIABLE = YES -MACOSX_DEPLOYMENT_TARGET = 11.0 +MACOSX_DEPLOYMENT_TARGET = 13.0 IPHONEOS_DEPLOYMENT_TARGET = 15.0 //SDKROOT = macosx SWIFT_SWIFT3_OBJC_INFERENCE = Off diff --git a/xcconfig/common/NetNewsWire_mac_target_common.xcconfig b/xcconfig/common/NetNewsWire_mac_target_common.xcconfig index 94e967287..bf6df1e67 100644 --- a/xcconfig/common/NetNewsWire_mac_target_common.xcconfig +++ b/xcconfig/common/NetNewsWire_mac_target_common.xcconfig @@ -6,5 +6,5 @@ ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon COMBINE_HIDPI_IMAGES = YES -MACOSX_DEPLOYMENT_TARGET = 11.0 +MACOSX_DEPLOYMENT_TARGET = 13.0 SDKROOT = macosx; From 5750b7c250d10cc2652298136fd4e7b059511c4f Mon Sep 17 00:00:00 2001 From: Stuart Breckenridge Date: Tue, 30 May 2023 09:39:51 +0800 Subject: [PATCH 2/2] Removes @available for iOS 14, 15 --- Shared/AboutData.swift | 3 --- Shared/Widget/WidgetDataEncoder.swift | 1 - 2 files changed, 4 deletions(-) diff --git a/Shared/AboutData.swift b/Shared/AboutData.swift index 03e0cc95a..f2966f774 100644 --- a/Shared/AboutData.swift +++ b/Shared/AboutData.swift @@ -8,12 +8,10 @@ import Foundation -@available(iOS 15, *) protocol LoadableAboutData { var about: AboutData { get } } -@available(iOS 15, *) extension LoadableAboutData { var about: AboutData { @@ -27,7 +25,6 @@ extension LoadableAboutData { } -@available(iOS 15, *) struct AboutData: Codable { var PrimaryContributors: [Contributor] var AdditionalContributors: [Contributor] diff --git a/Shared/Widget/WidgetDataEncoder.swift b/Shared/Widget/WidgetDataEncoder.swift index c624e725e..acd09f91c 100644 --- a/Shared/Widget/WidgetDataEncoder.swift +++ b/Shared/Widget/WidgetDataEncoder.swift @@ -67,7 +67,6 @@ public final class WidgetDataEncoder { } } - @available(iOS 14, *) private func encodeWidgetData(completion: @escaping (WidgetData?) -> Void) { let dispatchGroup = DispatchGroup() var groupError: Error? = nil