Is it possible to compile/run Swift code, entered by a user, inside an iOS app? If so, how?
Asked
Active
Viewed 152 times
1 Answers
2
What you are asking is how to run or interpret Swift code that is provided at run time, like the Swift command-line REPL or the iPad's Swift Playgrounds app. The full answer is really much too complicated for stackoverflow.
You'll need to use the Swift compiler source code to do this. Start by looking at swift-lldb (the version of the llvm project's debugger with Swift support), which does what you're describing.

rob mayoff
- 375,296
- 67
- 796
- 848