I'm usually a .NET developer used to using Visual Studio so please forgive me if I get some of the iOS terminology wrong.
What I am trying to do is reference a type defined in an Objective-C library in a new Swift iOS application.
Specifically, I am trying to get dependency injection working using the CoreMeta library as described by the author of [this article(https://danielsaidi.wordpress.com/2014/09/04/my-approach-to-ioc-in-ios/).
In XCode, I have created a new blank single view app using swift, and I have added a reference to the CoreMeta library mentioned in the article (Note: I'm a bit confused by what Xcode needs in terms of adding a reference. I tried dragging and dropping the library onto the swift app and adding both projects to a new workspace, but both methods lead to the same problem I am about to describe)
I understand that I need a bridging header, so I right-click the swift project and add a new file, select header file and add a new header in the format projectname-bridging-header.h.
The documentation I have read suggests that Xcode should offer to create this for me, But I have not had this dialog pop up.
In the build settings of the swift project, under the general tab, I have the libCoreMeta.a file added (i'm assuming this is the built assembly from the objc library) and in Build Settings under Swift Compiler - Code Generation I have the bridging header value pointing to the file I added.
This is where I may be getting confused. In the bridging header file every single variation of an import statement I try to do results in a "file not found" error and thus no types can be used in the rest of the app.
In the article, the IoCContainer object is defined in NSObject+IoCContainer.h so any variation of #import "NSObject+IoCContainer.h" does not seem to be working.
I'm sure this is something very obvious I am missing here, so any help would be great.
Edit
For simplicity sake, I just created a new swift app, added the CoreMeta library to it, added an ObjectiveC file (and got the request to create a bridging header) but I still cant work out what to add to to the bridging header to access the stuff in the CoreMeta library. File structure below
and TestSwiftApp-Bridging-Header.h
I obviously have a knowledge gap in how namespaces and stuff works with iOS
See Question&Answers more detail:
os