mirror of
https://github.com/XcodesOrg/XcodesApp.git
synced 2026-03-25 08:55:46 +00:00
Remove outdated version checks
This commit is contained in:
parent
f62c5139f0
commit
4394c48e11
3 changed files with 11 additions and 31 deletions
|
|
@ -20,29 +20,17 @@ struct NavigationSplitViewWrapper<Sidebar, Detail>: 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)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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")
|
||||
})
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue