jung-yun / swift-cpp-bridging

Demonstrating how to bridge C++ code base to Swift, alongside with objective-C

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

swift-cpp-bridging

Demonstrating how to bridge C++ code base to Swift, alongside with objective-C

key points

overall diagram

from: https://medium.com/@cecilia.humlelu/using-c-c-and-objective-c-frameworks-in-swift-apps-6a60e5f71c36

step

  1. C++ 파일 작성
  2. Objective C++ Wrapper 작성
  3. 브릿지 헤더에 Objective C++의 헤더 추가
  4. 호출

renaming the CWrapper.m into Cwrapper.mm

to become an Objective-C++ file which supports both C++ and Objective-C

result(example)

from: https://jk2b.tistory.com/5

references

About

Demonstrating how to bridge C++ code base to Swift, alongside with objective-C


Languages

Language:C++ 33.7%Language:Swift 32.4%Language:Objective-C++ 21.6%Language:Objective-C 12.3%