Closed luispadron closed 2 years ago
Two thoughts:
Two thoughts:
- Should we limit this behavior to iOS 15+, since it doesn't seem to affect older versions?
- Let's add a comment in the code explaining why we're changing threading behavior here.
@NickEntin
Good call on #1, added and availability check! For #2 I added a comment!
Summary
With iOS 15 devices I am getting a UI access outside of main thread crash:
This PR corrects this crash by ensuring we access
AS_traitCollection
via the main queue.This is a workaround while we figure out why this is now crashing on iOS 15+ simulator devices. From our investigation we found that UIKit is calling
traitCollection
from a background queue and thus causing this to crash. Without swizzling this crash does not occur.