On an Apple platform? If so, this should be relatively straightforward. You should give it a try with a test project and see how you get along.
I tried it here in my office and didn’t encounter any significant difficulties. My main problem was that I had to remember to mark all the Swift APIs as
public
(-:
Here’s my Swift code from the framework:
import Foundation
public class Fff : NSObject {
public func test() {
NSLog("Fff.test()")
}
}
And here’s the app’s Objective-C code calling it:
@import MyFramework;
…
[[[Fff alloc] init] test];
…
As a practical measure you may want to export your Swift APIs as Objective-C, because the interoperability story there is really nice. If you then want to call it from C++ you can use Objective-C++ to gateway through.
Share and Enjoy
—
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"