kst_v6
1
I'm wondering if static parameter functions created in Swift can't be used in ObjectC.
xcode version is 15.1 (15C65)
tera
2
Yes, this should work:
@objc class MyClass: NSObject {
@objc static func foo(_ param: Int) {}
@objc static func bar(param: Int) {}
}
void test(void) {
[MyClass foo:42]; // ✅
[MyClass barWithParam:24]; // ✅
}
The obj-c name could be customised if needed if you don't like the name made by default.