IOS: project OC bridging Swift, has no error but cannot call the specific method of swift

1. The project is an old OC project. In the bridge swift
2.build Setting configuration, Defines Module is changed to yes,product Name as the project name, the bridge file is automatically generated by the system and the path is correct
3. Create an extremely simple swift file and import (project name-Swift.h)

import Foundation

public class demoTest : NSObject {
    
    public func mydog() -> Void {
        print("god like")
    }
}

View (project name-Swift.h file) there is no mydog () method, only one init method and the call will fail

SWIFT_CLASS("_TtC7example8demoTest")
@interface demoTest : NSObject
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
@end

there is no-(void) mydog; above

the reason for kneeling and begging for the great god

Mar.17,2021

method preceded @ objc

Menu