Here's my sample project:
I'm trying to create a Swift framework to use in an Objective-C app, build works fine, configuration all keep to default, added the framework in the app, imported ok, but I cannot access the class written in Swift, which already marked with @objc
and public
, not sure if anyone have an idea where I did wrong
Framework:
@objc(TVNFoo) @objcMembers public class Foo: NSObject {
public static let shared = Foo()
public func foo() {
print("foo")
}
}
App:
@import TestFramework;
[TVNFoo shared]; // Error undeclared identifier