From ab30a34f279fbf99203859c1664e1619ec80c53c Mon Sep 17 00:00:00 2001 From: Axel Martinez Date: Mon, 30 Nov 2026 06:48:06 +0100 Subject: [PATCH] Fix building with Xcode 26 by leaving out the macOS 27 menu item image visibility --- Containers/Views/System/SystemStatusControl.swift | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Containers/Views/System/SystemStatusControl.swift b/Containers/Views/System/SystemStatusControl.swift index 4079b07..de5dc9f 100644 --- a/Containers/Views/System/SystemStatusControl.swift +++ b/Containers/Views/System/SystemStatusControl.swift @@ -103,10 +103,13 @@ struct SystemStatusControl: View { ) -> NSMenuItem { let item = NSMenuItem(title: title, action: action, keyEquivalent: "") item.image = NSImage(systemSymbolName: symbol, accessibilityDescription: title) - // macOS 27 hides menu item images unless an item asks to show them. + // macOS 27 hides menu item images unless an item asks to show them. The property is only in the macOS 27 + // SDK, which comes with Swift 6.4, so earlier Xcode versions leave it out. + #if compiler(>=6.4) if #available(macOS 27, *) { item.preferredImageVisibility = .visible } + #endif item.isEnabled = isEnabled item.target = target return item