From 4394c48e11ee97866c266b9ea32a5e543c312ff5 Mon Sep 17 00:00:00 2001 From: Daniel Chick Date: Mon, 11 Mar 2024 21:51:35 -0500 Subject: [PATCH] Remove outdated version checks --- .../Common/NavigationSplitViewWrapper.swift | 30 ++++++------------- Xcodes/Frontend/MainWindow.swift | 6 +--- Xcodes/XcodesApp.swift | 6 +--- 3 files changed, 11 insertions(+), 31 deletions(-) diff --git a/Xcodes/Frontend/Common/NavigationSplitViewWrapper.swift b/Xcodes/Frontend/Common/NavigationSplitViewWrapper.swift index 594c811..a07d16f 100644 --- a/Xcodes/Frontend/Common/NavigationSplitViewWrapper.swift +++ b/Xcodes/Frontend/Common/NavigationSplitViewWrapper.swift @@ -20,29 +20,17 @@ struct NavigationSplitViewWrapper: View where Sidebar: View, De } var body: some View { - if #available(iOS 16, macOS 13, tvOS 16, watchOS 9, visionOS 1, *) { - // Use the latest API available - NavigationSplitView { - - if #available(macOS 14, *) { - sidebar - .navigationSplitViewColumnWidth(min: 250, ideal: 300) - } else { - sidebar - } - } detail: { - detail - } - .navigationSplitViewStyle(.balanced) - } else { - // Alternative code for earlier versions of OS. - NavigationView { - // The first column is the sidebar. + // Use the latest API available + NavigationSplitView { + if #available(macOS 14, *) { + sidebar + .navigationSplitViewColumnWidth(min: 250, ideal: 300) + } else { sidebar - .frame(minWidth: 250) - detail } - .navigationViewStyle(.columns) + } detail: { + detail } + .navigationSplitViewStyle(.balanced) } } diff --git a/Xcodes/Frontend/MainWindow.swift b/Xcodes/Frontend/MainWindow.swift index 88b301d..7b020ad 100644 --- a/Xcodes/Frontend/MainWindow.swift +++ b/Xcodes/Frontend/MainWindow.swift @@ -55,11 +55,7 @@ struct MainWindow: View { .help("PreferencesDescription") } else { Button(action: { - if #available(macOS 13, *) { - NSApp.sendAction(Selector(("showSettingsWindow:")), to: nil, from: nil) - } else { - NSApp.sendAction(Selector(("showPreferencesWindow:")), to: nil, from: nil) - } + NSApp.sendAction(Selector(("showSettingsWindow:")), to: nil, from: nil) }, label: { Label("Preferences", systemImage: "gearshape") }) diff --git a/Xcodes/XcodesApp.swift b/Xcodes/XcodesApp.swift index 611341b..67247f4 100644 --- a/Xcodes/XcodesApp.swift +++ b/Xcodes/XcodesApp.swift @@ -169,9 +169,5 @@ class AppDelegate: NSObject, NSApplicationDelegate { } func localizeString(_ key: String, comment: String = "") -> String { - if #available(macOS 12, *) { - return String(localized: String.LocalizationValue(key)) - } else { - return NSLocalizedString(key, comment: comment) - } + return String(localized: String.LocalizationValue(key)) }