NativeScript/ios-jsc

Cannot export class, interface in Swift framework when run TNS_TYPESCRIPT_DECLARATIONS_PATH with #if 0 #elif defined(__arm64__) && __arm64__

nguyenhuutinh opened this issue · 1 comments

hi team,
I have a local framework, working with native projects and I want to build the framework for NS as a plugin.

I've done integrating android .aar to NS project but for iOS, I got some problem.

After I run TNS_TYPESCRIPT_DECLARATIONS_PATH="$(pwd)/app/typings" tns build ios
I got a lot of generated classes, including my framework
Screenshot 2020-12-10 at 5 35 33 PM

But the problem is generated file only OBJECT_C functions, didn't include my class / functions (SWIFT)
even I added a TestClass to check but it wasn't generated it.

import Foundation
@objc(TestClass)
public class TestClass: NSObject {
    @objc public func echo(param: String) -> String {
        return param
    }
}

In my framework,
there is a -swift.h class which contain our swift class / functions, but I couldn't find out why it didn't generate


SWIFT_CLASS_NAMED("TestClass")
@interface TestClass : NSObject
- (NSString * _Nonnull)echoWithParam:(NSString * _Nonnull)param SWIFT_WARN_UNUSED_RESULT;
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
@end

Do you know what I'm wrong? Thank you

fixed it by correct objc-swift. thanks