Posted at

UIView.addMotionEffect(_:) が main thread checker に引っかかる

UIView.addMotionEffect(_:)

https://developer.apple.com/documentation/uikit/uiview/1622586-addmotioneffect

これが使われてると main thread checkerが警告を出してくる

=================================================================

Main Thread Checker: UI API called on a background thread: -[UIApplication applicationState]
PID: 1778, TID: 142950, Thread name: com.apple.CoreMotion.MotionThread, Queue name: com.apple.root.default-qos.overcommit, QoS: 0
Backtrace:
4 libobjc.A.dylib 0x00000001f8fc3894 <redacted> + 56
5 CoreMotion 0x00000001ff840760 CoreMotion + 304992
6 CoreMotion 0x00000001ff840c94 CoreMotion + 306324
...

iOS12からだと思われる

この辺の有名OSSでも使われているので困る…

https://github.com/SVProgressHUD/SVProgressHUD/issues/930

main threadで実行させてるのにmain thread checkerに引っかかるので解決策は謎です…