How to make sure that my app icon does not stay in the "recently used apps" on the Dock?

50 Views Asked by At

My SwiftUI app for macOS allows only a single window. When I open and then close it, its icon remains in the "recently used apps" section of the Dock:

enter image description here

Is there a way to make sure that my app icon does not stay in the "recently used apps" in the Dock?

PS. The reason I need this is because my app can restart as root (after a UI command), which leaves two icons on the Dock there.

0

There are 0 best solutions below