Closing Mac application (clicking red cross on top) and reopening by clicking dock icon

前端 未结 3 1915
醉酒成梦
醉酒成梦 2021-01-02 02:30

When I close my Mac application (by clicking red cross button on window top bar) the app icon stays in the dock at the bottom. Now this is normal behaviour. When user click

3条回答
  •  悲哀的现实
    2021-01-02 02:54

    I think that the answers above aren't fully correct, to achieve this you should override applicationShouldHandleReopen(_:hasVisibleWindows:) https://developer.apple.com/reference/appkit/nsapplicationdelegate/1428638-applicationshouldhandlereopen

提交回复
热议问题