I've found this page which tells you how to convert your Nim files to C code and add them to an Xcode project, but what do you do after that to run the procedures defined in that Nim code?
I made a quick and dirty example, this is the entire file:
proc NimMain() {.importc.}
proc greet*() {.exportc.} =
NimMain()
echo("Hello from Nim!")
How do I call greet in this context? In theory I would run an init function defined in Nim which would run any initialisation code needed for an app.
This helps a ton, thanks.
After poking around with the compiler options, I found that the key here is the --header flag. I ended up with a simple line that looks like this:
nim objc -c --noMain --header *.nim
The header flag has the same name as the file you compiled, so compiling a Nim file called yourfilehere.nim will give you a yourfilehere.h that you can import into your other Objective-C files. As long as you have procedures marked with the {.exportc.} pragma you'll be able to call them from your code.