Hello @adevaykin, @Justin, et al!
I need some help getting the 'Game Mode' enabled and working in a SwiftUI project for macOS (Deployment Target: 14.0; Target minimum deployment: macOS 14.0).
For the Target's identity, the App Category is set to 'Games'. When the app is build and run, the following key appears in the Info.plist: <key>LSApplicationCategoryType</key> <string>public.app-category.games</string>"
.
The app launches in full-screen with the following SwiftUI structure:
struct AppName: App {
var body: some Scene {
WindowGroup {
ContentView()
.onAppear {
DispatchQueue.main.async {
if let window = NSApplication.shared.windows.last {
window.toggleFullScreen(nil)
}
}
}
}
}
}
When app is launched, the app loads full-screen however the "game controller" icon does not appear in the menu bar.
Any suggestions?