You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
||4 years ago|
|rin-bridge-code||4 years ago|
|rin-swift||4 years ago|
|rin-test.xcodeproj||4 years ago|
|README.md||4 years ago|
Test of RInside with R 3.6, Xcode 11 & Swift 5 on macOS Catalina
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:
- Search paths:
- Frameworks, Libraries and Embedded Content:
- Hardened Runtime is enabled with an entitlement of "Disable Library Validation" because 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
- one ^^ corresponding
.hppfile that has no imports or includes of anything R/Rcpp-ish and defines the functions you're going to expose to Swift
- one bridging header (setup as as an "Objective C Bridging Header" under "Swift Compiler" in the General settings. This should just include ^^
- R (RInside) is initialized in the
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: