Question: I'm attempting to use Swift classes in my Objective-C code, however my Swift classes don't seem to appear in the generated header. As a result, my build fails with "Use of undeclared identifier 'HelloWorld'".

I used the templates to create a project called TestApp.

I have the following Build Settings in my target:

* Product Name : TestApp
* Product Module Name : TestAppModule
* Defines Module : Yes

Apple's documentation says to use `#import <TestApp/TestAppModule-Swift.h>` but this doesn't work.

Instead, I'm using `#import "TestAppModule-Swift.h"` in my ".m" file. It seems to find this.

I'm able to navigate to it, and it looks like this...

```
// Generated by Swift version 1.0 (swift-600.0.34.4.5)

#if defined(__has_include) && __has_include(<swift/objc-prologue.h>)
# include <swift/objc-prologue.h>
#endif

...etc...

```

but no classes defined in there.

I have a Swift file in the project that looks like this...

```
class HelloWorld {    
    func hello() {
        println("hello world")
    }
}

```

Why isn't this working using the standard header file location `#import <TestApp/TestAppModule-Swift.h>`? 

How can I get my swift classes in that header file, so I won't get the "undeclared identifier" error?

Answer: 
Here's how I have gotten it to work. You can see a more large-scale answer [here.](https://stackoverflow.com/questions/24002369/how-to-call-objective-c-code-from-swift/24005242#24005242)

Change this:

```
class HelloWorld {    
    func hello() {
        println("hello world")
    }
}

```

To:

```
@objc class HelloWorld { 

    class func newInstance() -> HelloWorld {
        return HelloWorld()
    }

    func hello() {
        println("hello world")
    }
}

```

Then, In your ObjC file:

```
#import "TestApp-Swift.h"

```

And call like this:

```
HelloWorld * helloWorld = [HelloWorld newInstance];
[helloWorld hello];

```
A more convenient way would be to inherit from NSObject. Like so:

```
class HelloWorld: NSObject {    
    func hello() {
        println("hello world")
    }
}

```