I believe fatalError(_:file:line:)
should be used only if the application enters an unknown state, a state it doesn't know how to handle. Remember that your application will crash and burn if it throws a fatal error and eventually reporting a crash in Firebase Crashlytics.
If you use exit(0)
, your application will be rejected due to the following reason:
We found that your app includes a UI control for quitting the app. This is not in compliance with the iOS Human Interface Guidelines, as required by the App Store Review Guidelines.
To avoid any such rejections, suspend the application using the following code snippet.
UIApplication.shared.perform(#selector(NSXPCConnection.suspend))
This line of code is in compliance with the iOS Human Interface Guidelines and your app won't be rejected.