I not see how to update my prevue comment. so I fix it.
keep swift code in different target(framework type)
set swift target build settings:
SWIFT_INSTALL_OBJC_HEADER to yes.
C++ and Objective-C Interoperability to C++ / Objective-C++
add swift target as Embed in c++ target(this automatically add it to be linked)
include -Swift.h where you need to use. and use it.
set c++ target :: build settings:: HEADER_SEARCH_PATHS to $(BUILT_PRODUCTS_DIR)/.framework/Headers
abut part 5, I sure someone can give better path or way, but this work.
Topic:
Programming Languages
SubTopic:
Swift
Tags: