I'm having problems executing some Swift code in an existing ObjC project. This is my first attempt at Swift so I'm sure I'm missing something simple.
I have added my new swift file to my project - this process generated the bridging header. So now I have the following:
bridging-header file
//
// Use this file to import your target's public headers
// that you would like to expose to Swift.
//
#import "historyViewController.h"
In my swift file I have the following test class and function:
import Foundation
@objc class Hello: NSObject {
func sayHello() {
print("Hi There")
}
}
In my historyViewController.m file I have the following
#import "xx-Bridging-Header.h"
In my historyViewController.h file I have the following
@class Hello;
How do I actually go about executing the sayHello function from within my historyViewController.m file? I've tried [Hello sayHello]; - but get 'no known class method'.