I faced with issue after updating Xcode to version 13. As the compiler complains about whole module compilation, we need to use the incremental mode.
To do this:
Select your target and go to Build Settings -> Compilation Mode -> Switch to “Incremental”