XCoordinator
XCoordinator copied to clipboard
Crashing push on XCode 14 beta
Crashing push on NavigationController extension, XCode 14 beta 5, is complaining that the method must be made on main thread.
@hugovanderlei can you confirm that trigger is called from the main thread in this case?
I tested it in both xcodes, and it always worked on XCode 13, where the method was called on the main thread. However, when I use XCode 14, the method is not called on the main thread, as shown in the images.
I didn't change anything in code, just compiled it in both xcodes.
@pauljohanneskraft Same problem here, any news?
Same problem. Any news?
I will try this out (hopefully today) in one of our apps and get back to you - did anyone already try to fix this? I would assume that for some reason, CATransaction no longer run on the main thread - otherwise it would need to originate from the call site, which would mean this is an RxSwift issue and not a XCoordinator problem.
I was able to solve it on my project. On XCode 14, I observed that even when an async trigger method is called by another method with @ MainActor, the trigger method is no longer on the main thread.
I believe adding @ MainActor to the async trigger method might work.

In my project, I had to use MainActor.run to call the trigger.
await MainActor.run { router.trigger(.checkAuthentication) }
This forces the trigger async method to be executed on the main thread.
but this also happens with the non-async methods, right? or is this actually an issue that is isolated to the async overload?
In my case it only happened on async methods. I guess something was changed in the Concurrency on swift 5.7
Any news?
any news?
any news?
any news?
Sorry for the long wait. I will try to figure out the root cause to this in the coming days - can anyone confirm or deny that this only affects the async extensions and not the regular trigger methods?
I pushed a potential fix to https://github.com/QuickBirdEng/XCoordinator/pull/239 - Can anyone confirm that this solves the issue?
Hi @pauljohanneskraft, I have tried your fix in all the afflicted sections in my app and everything is fixed. Thank you. My team is looking forward to the new version. well done!
Thank you very much for the feedback - I will try to release it in about a week, hope that's fine. Until then, feel free to specify that branch for now as a temporary workaround.
The fix has just been merged and will be released shortly.