Apple has a really nice utility straightforwardly called the Main Thread Checker. It detect uses of APIs on a background thread that really should be on the main thread.
Updating UI on a thread other than the main thread is a common mistake that can result in missed UI updates, visual defects, data corruptions, and crashes.
And someone has put together a page documenting how to configure the Main Thread Checker for your own specific needs. It’s straightforwardly called Configuring the Main Thread Checker.
Enjoy getting rid of some flakey code in your app! Via iOS Dev Weekly.
P.S. There’s another utility from Apple called Thread Sanitizer, to “Audit threading issues in your code”. 🤷🏻♂️