I have in my Bridging-Header.h:
#ifndef EXAMPLE_HEADER_H
#define EXAMPLE_HEADER_H
#import "com/example/MyObject.h"
#endif
The Swift Compiler - Code Generation also has been updated to have a reference to this file under Build Settings.
While the bridge header file alone compiles and runs with the project, as soon as I try to initialize an object, like in AppDelegate.swift:
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch.
let example = ComExampleMyObject()
return true
}
I get the following error:
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_ComExampleMyObject", referenced from:
type metadata accessor for __ObjC.ComExampleMyObject in AppDelegate.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Any ideas on what went wrong?