keyeh / VPAnalysis-SwiftAndCPP

An attempt to integrate the VPAnalysis C++ library into a project with Apple's Swift language

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HelloSwiftAndCPP

This is an attempt to integrate the VPAnalysis C++ library into a project with Apple's Swift language using Objective C. I wrote it trying to figure out how I can add existing C++ code into a video poker app written in Swift. It's meant to be C++/ObjC/Swift 101 just to show the interop between the three, without getting bogged down in frameworks.

main.swift

  • The main program that calls both Objective C and C++ (via Objective C++) code

SomeCPPClass.cpp/h

  • A regular C++ class using iostream and string

HelloSwiftAndCPP-Bridging-Header.h

  • The file necessary to expose the Objective C/C++ classes to Swift

ObjCpp.mm/h

  • Objective C++ class that uses SomeCPPClass

VPAnalysisCPP/*

About

An attempt to integrate the VPAnalysis C++ library into a project with Apple's Swift language


Languages

Language:C++ 99.5%Language:Objective-C 0.2%Language:Swift 0.1%Language:Objective-C++ 0.1%Language:C 0.1%