2

My MacOs app has been rejected. One of the point to solve is:

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".

I really do not understand what to do... This is the first time I am submitting a MacOs App...

This is my AppDelegate.swift file.

trojanfoe
  • 120,358
  • 21
  • 212
  • 242
Wild8x
  • 459
  • 4
  • 13
  • It's your menu resource you need to show, that's in your storyboard. – trojanfoe Apr 08 '20 at 16:33
  • Thanks for your replly, Thanks to you I am getting closer... For the moment my storyboard looks like a simple horizontal bar with nothing attached to it. No View attached to it. I will dig a bit more to find how to attached the main window to the Window menu. – Wild8x Apr 08 '20 at 17:07
  • If you create a new macOS app in Xcode, with a single view or whatever, you should see how it's done. – trojanfoe Apr 08 '20 at 18:16

1 Answers1

2

Please find below the solution that I share with you. Thanks Trojanfoe for pointing me in the good direction. I hope it will help MacOS beginners like me.

My app has a home page that you see at start up and stays on the screen as long as you do not interact. Once you interact you leave the home page and cannot come back to it because there is no button in the app that allows it or there is no Main Window menu item that allows it.

The Apple review Team rejected my app and said: « 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 always contains a Window menu".

I then sick for help on Stackoverflow and also on the web and finally find out the below solution of adding a Window menu item that will display the home page if clicked.

Click on Main.storyboard to display the Main Menu

Click on the Window’s Menu item

Click on + to select a Menu Item and drag it into the Window’s Menu item

Rename item into “Home Page” on the above left and the right locations

Open the AppDelegate.swift file on the right side

CTRL + drag the “Home Page” item to the AppDelegate.swift file for IBAction creation

The IBAction is now ready to be filled-up

Tell the action to display the Home Page View (in my App it is ContentView())

Now if we start the app, we have a “Home Page” item in the Main menu Window and if we click on it, we go the ContentView() that is my app Home Page.

Code for the action:

@IBAction func DisplayHomePAge(_ sender: NSMenuItem) {
    window.contentView = NSHostingView(rootView: ContentView())
}
Krishna Raj Salim
  • 7,331
  • 5
  • 34
  • 66
Wild8x
  • 459
  • 4
  • 13
  • My MacOS app has been rejected again! The apple review team said: "The user interface of your app is not consistent with the macOS Human Interface Guidelines.

Specifically, we found that when the user closes the main application window there is no menu item to re-open it. The Window tab does not respond when pressed. 

 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 always contains a Window menu". – Wild8x Apr 09 '20 at 23:15
  • To solve the issue we must find the code to add to the IBAction that will allow the App to re-open once it has been closed by using the red dot located at the top left corner of all app window. For the moment the IBAction re-open the ContentView when the App is running but does not re-open the App if closed. – Wild8x Apr 10 '20 at 10:56
  • Finally I implement this solution that I explained on stackoverflow: https://stackoverflow.com/questions/61149135/how-to-use-the-macos-app-dock-menu-to-re-open-the-app-that-has-been-closed-by-u?noredirect=1#comment108186981_61149135 – Wild8x Apr 11 '20 at 12:52