Importing Objective-C into Swift, Xcode 14, Project-swift.h not generated

I just tried to expose a Swift class to an ObjC class, following the official but very short doc and some step-by-step little guides found here and there.

The "Project-swift.h" header is not auto-generated as I heard it should.

Note: I noted that when adding the 1st .m file in the swift project, Xcode says : "Would you like to configure an Objective-C bridging header?" then "Adding this file to 'Project' will create a mixed Swift and Objective-C target. Would you like Xcode to automatically configure a bridging header to enable classes to be accessed by both languages?"

...letting think it works both side with that file. Isn't it?

But the section of swift/doc (Importing Swift into Objective-C | Apple Developer Documentation) doesn't say that.

Trying in that state, instantiating 'MySwiftClass' in a method of 'MyObjCClass', I got the well know errors:
"Receiver 'MySwiftClass' for class message is a forward declaration" and "Receiver type 'MySwiftClass' for instance message is a forward declaration"

So I tried to create by hand the famous "Project-swift.h"... needless to say the compiler didn't fill it at the next build. No more with the Defines Module to YES as recommended here and there.

Because I don't know at all what syntax use to expose swift class in this manually created header...

I call for help :slight_smile:

Bridging header typically named "XXX-Bridging-Header.h" is to export Obj-C things to Swift, the opposite of what you need here.

"XXX-Swift.h" file is to export Swift things to Objective-C – it's created automatically, you don't create it manually. Use "Module Name" for "XXX". By default PRODUCT_MODULE_NAME matches TARGET_NAME but you can change that if needed. To view / change module name go to Xcode target settings and type "Module Name" into the filter field, in there look for "Product Module Name".

Thanks to your answer @tera it allowed me to better understand the mechanism and over all see that was a mistake in my process: Project-Swift.h with a S capital.

Thank very much.