For the last week Xcode has simply refused to update the Swift Bridging Header when I add new Swift Classes?! It is getting to be a real pain in ****. I refactor a class into Swift then have to spend 2 days trying to get Xcode to see the new class. What the heck?! Anyone have any clue what is going on here and how to fix this?
This is a MacOS Project that is quite old and has a lot of Obj-C that I have been refactoring over to Swift class by class. It was fine until recently, but lately it has been rather tough sledding.
I have tried:
-
Numerous clean and rebuilds.
-
Deleting the derived data folder manually.
-
Renaming the ProjectName-Swift.h file - One time doing that seemed to cause Xcode to notice and it rebuilt it but not subsequent times.
-
Double checked all the settings. These are the settings for the Relevant section and all looks ok to me according to the Docs.
I am out of ideas and while I see people running into this issue I have not found a reliable way to fix this.
So the only solution I was able to arrive it was to:
- NOT use the same name for the Swift Class as the old class being refactored into Swift.
- Have BOTH in the project.
- Get it to build.
- Then go back and change all the references to the old class name to new class name.
This was the ONLY way to get the ProjectHeader-Swift.h to get built and include the class. This file should probably be built on the fly and dynamically as long as there are no errors in any Swift Classes.