This is a sample Xcode 11 project (a nigh vanilla/default SwiftUI project) which has:
all setup including sample bridging code to enable function execution and data exchange between Swift 5 and R.
A few key things are included/set:
Disable Library Validationbecause the RInside and R shared libraries aren't codesigned (see
.mmfile which lets Xcode know we're using Objective-C++. This is where you include things like
RInside.hor other C/C++ libraries
.hppfile that has no imports or includes of anything R/Rcpp-ish and defines the functions you're going to expose to Swift
Objective C Bridging Headerunder
Swift Compilerin the General settings. This should just include ^^
AppDelegate.swiftand an example of calling functions with and without parameters is in
There are quite a number of post-compilation yellow flags due to the R-ish headers but it builds and runs fine.
Built on the shoulders of: