If my app is running in the background, and I force close it, how can I get the app to detect it was force closed in the background? Is there a specific function I can call to detect this?
You can use
func applicationWillTerminate(_ application: UIApplication) {
}
within AppDelegate class to observe when the app will be terminated. Documentation.
Edit: Please, note that as it written in docs
Suspended apps are not notified of termination