How to display a welcome window like in Xcode?

For example, when you start Xcode, a welcome window appears. You select a recent project, and Xcode opens a new window with your project and closes the welcome window. After closing the project window, only the main menu is displayed. And if you click on the Xcode icon in the dock, a welcome window will appear again.

So the question is how to open the welcome window if the user clicks on the dock icon?

+4
source share
1 answer

You can do this using a special application delegate. When an application is opened from a search device or a docking station, if it does not have windows, it will call applicationOpenUntitledFile: delegate on it (unless you override other methods to prevent it). You can use this method to display a welcome window. I would also suggest creating a custom window controller for your window to handle all actions with documents (open and new) so that you can hide the window if the user creates a document using the menu bar. See NSApplicationDelegate Link .

+6
source

All Articles