jdg / MBProgressHUD

MBProgressHUD + Customizations
http://www.bukovinski.com/
MIT License
16.01k stars 3.56k forks source link

Main thread checker #571

Closed violettoads closed 5 years ago

violettoads commented 5 years ago

Fix for: http://www.openradar.me/45003816

Creating a new instance of CMMotionManager always results in a Thread Checker exception, on iPhone XR, XSMax

Log: Main Thread Checker: UI API called on a background thread: -[UIApplication applicationState]

Solution: force call of UIView - (void)addMotionEffect:(UIMotionEffect *)effect method from main thread.

matej commented 5 years ago

I don't really understand this fix. This code should already be running on the main thread and this doesn't change that (other that dispatching execution to a later run loop iteration).

I instead decided to disable motion effects by default, because people keep getting confused by this issue. https://github.com/jdg/MBProgressHUD/issues/552#issuecomment-511232228

The effect is subtle enough that I doubt anybody will really notice in the end.