AramMoon / CCppWrap

Swift에서 C, C++ 사용하기

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CCppWrap

CI Status Version License Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

CCppWrap is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'CCppWrap'

Author

28850809, arammoon11@gmail.com

License

CCppWrap is available under the MIT license. See the LICENSE file for more info.

C, C++ 코드를 Swift에서 사용하는 방법

  1. C 는 직접 불러 쓴다
  2. C++은 ObjectiveC로 Wrapping 해서 사용한다.
  3. 라이브러리로 만들어서 C++을 감싼 ObjectiveC, 이것을 사용하는 Swift Library 2개를 만들어서 사용한다.

라이브러리 만들기

  1. pod library를 만든다

    pod lib create [프로젝트이름]

  2. pod spec 및 파일 구조 변경(아래 두파일을 참고하여 위치를 본다)
  • CCppWrapObjC.podspec
  • CCppWrapSwift.podspec

About

Swift에서 C, C++ 사용하기

License:MIT License


Languages

Language:Makefile 64.9%Language:C 16.2%Language:Objective-C 12.4%Language:Swift 2.9%Language:Ruby 1.3%Language:Objective-C++ 0.9%Language:Shell 0.7%Language:C++ 0.7%