If I have a .swift file, Apple's documentation says I can use Xcode to create an ObjC wrapper header for it, so I can call it from other ObjC code: https://developer.apple.com/documentation/swift/importing-swift-into-objective-c
But there's no way of automating something like that as part of an external build (I've also just found it clunky and unreliable). So is there a way of generating the wrapper from the command line, say with some xcodebuild or swiftc command?
CodePudding user response:
Found this: https://theswiftdev.com/how-to-use-a-swift-library-in-c/
Looks like swiftc has a -emit-objc-header flag.