Hello, I'm currently coding a productivity app which help user to focus while studying through restricting access to website and app they have selected, however for now, they can really easily make this uselles trhough quitting the app using command + Q or force quit the app in the activity monitor. Do you know how could I block user to quit the app while she is running, and it is allowed by apple guideline ?
It is possible for a macOS to not terminate when asked. See the applicationWillTerminate(_:)
delegate method.
However, as darkpaw notes, this is quite worrying from an HI perspective. Users expect apps to quit when asked. Moreover, by not quitting you’ll also prevent both shutdown and restart.
Also, there’s no good way to prevent Force Quit.
macOS has a built-in system for letting users stay focused, namely Focus. I recommend that you explore ways of integrating into that.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"