Skip to content

Commit 4394c48

Browse files
committed
Remove outdated version checks
1 parent f62c513 commit 4394c48

File tree

3 files changed

+11
-31
lines changed

3 files changed

+11
-31
lines changed

Xcodes/Frontend/Common/NavigationSplitViewWrapper.swift

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -20,29 +20,17 @@ struct NavigationSplitViewWrapper<Sidebar, Detail>: View where Sidebar: View, De
2020
}
2121

2222
var body: some View {
23-
if #available(iOS 16, macOS 13, tvOS 16, watchOS 9, visionOS 1, *) {
24-
// Use the latest API available
25-
NavigationSplitView {
26-
27-
if #available(macOS 14, *) {
28-
sidebar
29-
.navigationSplitViewColumnWidth(min: 250, ideal: 300)
30-
} else {
31-
sidebar
32-
}
33-
} detail: {
34-
detail
35-
}
36-
.navigationSplitViewStyle(.balanced)
37-
} else {
38-
// Alternative code for earlier versions of OS.
39-
NavigationView {
40-
// The first column is the sidebar.
23+
// Use the latest API available
24+
NavigationSplitView {
25+
if #available(macOS 14, *) {
26+
sidebar
27+
.navigationSplitViewColumnWidth(min: 250, ideal: 300)
28+
} else {
4129
sidebar
42-
.frame(minWidth: 250)
43-
detail
4430
}
45-
.navigationViewStyle(.columns)
31+
} detail: {
32+
detail
4633
}
34+
.navigationSplitViewStyle(.balanced)
4735
}
4836
}

Xcodes/Frontend/MainWindow.swift

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,7 @@ struct MainWindow: View {
5555
.help("PreferencesDescription")
5656
} else {
5757
Button(action: {
58-
if #available(macOS 13, *) {
59-
NSApp.sendAction(Selector(("showSettingsWindow:")), to: nil, from: nil)
60-
} else {
61-
NSApp.sendAction(Selector(("showPreferencesWindow:")), to: nil, from: nil)
62-
}
58+
NSApp.sendAction(Selector(("showSettingsWindow:")), to: nil, from: nil)
6359
}, label: {
6460
Label("Preferences", systemImage: "gearshape")
6561
})

Xcodes/XcodesApp.swift

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,5 @@ class AppDelegate: NSObject, NSApplicationDelegate {
169169
}
170170

171171
func localizeString(_ key: String, comment: String = "") -> String {
172-
if #available(macOS 12, *) {
173-
return String(localized: String.LocalizationValue(key))
174-
} else {
175-
return NSLocalizedString(key, comment: comment)
176-
}
172+
return String(localized: String.LocalizationValue(key))
177173
}

0 commit comments

Comments
 (0)