MacDeveloper

the user closes the main applica

2020-03-14  本文已影响0人  _我和你一样

苹果审核时,会给我们指出一些设计问题,比如苹果认为,用户关闭主窗口之后,没有菜单项来重新打开应用。

Specifically, we found that when the user closes the main application window there is no menu item to re-open it.

苹果给的处理方案:

It would be appropriate for the app to implement a Window menu that lists the main window so it can be reopened, or provide similar functionality in another menu item. macOS Human Interface Guidelines state that "The menu bar [a]lways contains [a] Window menu".

Alternatively, 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.

For information on managing windows in macOS, please review the following sections in Apple Human Interface Guidelines:
*The Menu Bar and Its Menus
*The Window Menu
*The File Menu
*Clicking in the Dock
*Window Behavior

我最终的处理方案是:

1.在Window菜单中增加一个菜单项用来重新打开应用。名字APP名称即可,另外再加上快捷键Cmd+O

2.在Dock菜单中也增加打开主窗口的菜单

3.点击Dock上的应用图标也可以打开主窗口。

    @IBAction func handleReopenApp(_ sender:Any?) {
        NSRunningApplication.current.activate(options: NSApplication.ActivationOptions.activateIgnoringOtherApps)
        currenWindow?.makeKeyAndOrderFront(self)
    }
上一篇 下一篇

猜你喜欢

热点阅读