This one only happens on the Mac. The app works, and the reviewer closes its window. The app is still running, its menu bar is still there, and nothing in it brings the window back. We received this exact Guideline 4 (Design) rejection on our own Mac utilities, so it is worth closing the window and looking for the way back by hand before you submit a Mac app.
What Apple said
Apple's message read: "when the user closes the main application window there is no menu item to re-open it." Apple offered two ways out:
- "implement a Window menu that lists the main window so it can be reopened, or provide similar functionality in another menu item", or
- "if the application is a single-window app, it might be appropriate to save data and quit the app when the main window is closed."
Why it happens
SwiftUI. If the main scene is a WindowGroup, Apple's docs say the app "continues to run even after closing all of its windows." The Window menu only lists open windows, so after ⌘W the window is gone from it. The menu way back is File > New, which opens a new window from the group. Some single-window apps remove it with CommandGroup(replacing: .newItem) { } because "New" makes no sense for them. That leaves no menu item at all.
AppKit. Unless your app delegate returns true from applicationShouldTerminateAfterLastWindowClosed(_:), the app stays running after its last window closes. If nothing in the menus calls the window back, you get the same dead end. If you create the window yourself in Swift, also set isReleasedWhenClosed = false (Apple's docs say Swift and ARC code needs to; it defaults to true for NSWindow) and keep a strong reference, so the same window can be shown again.
How to fix it
SwiftUI, single window: use a Window scene. Apple's docs say the Window menu lists singleton windows for you, and that "if your app uses a single window as its primary scene, the app quits when the window closes." That covers both of Apple's suggestions. Save the user's work as it changes, since closing the window now quits.
@main
struct NotesApp: App {
var body: some Scene {
Window("Notes", id: "main") {
ContentView()
}
}
}
SwiftUI, keep WindowGroup but quit on close: add an app delegate with @NSApplicationDelegateAdaptor and return true from applicationShouldTerminateAfterLastWindowClosed(_:). Or keep File > New instead of replacing .newItem with nothing.
AppKit: either quit on close, after saving:
func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
true
}
or keep the window alive and give it a way back. Add a Window menu item whose action calls mainWindow.makeKeyAndOrderFront(nil) (for example with NSApp.windowsMenu?.addItem(withTitle:action:keyEquivalent:)), and handle a Dock click too:
func applicationShouldHandleReopen(_ sender: NSApplication, hasVisibleWindows flag: Bool) -> Bool {
if !flag { mainWindow.makeKeyAndOrderFront(nil) }
return true
}
AppKit calls this when the user clicks the Dock icon or double-clicks the app again while it is running. The Dock click is a courtesy; Apple's message asks for a menu item, so do not ship the Dock handler alone.
30-second test
Launch the app, press ⌘W, and look for a way back using only the menu bar: the Window menu, the File menu, the app menu. Either the app has quit (and your work was saved) or a menu item reopens the window. If neither, a reviewer will find the same thing. Then click the Dock icon once and check that the window returns.
Other Mac-only rules are in 2.4.5, sandbox saves and update checks. For a broader pre-launch pass, see 2.1, App Completeness and the toolkit page.
These notes are from Obelisk Club's own submissions. Apple's wording and APIs change; check the current App Review Guidelines and Apple's documentation for exact behaviour.