SwiftRunner

SwiftRunner can execute the string written in Swift on runtime.
How to use
Execute string as Swift
import SwiftRunner
let text = "print(\"hello!\")"
let result = SwiftRunner.shared.run(string: text) // => hello!
switch result {
case .success(let stream):
stream.output // => "hello!\n"
case .failure(let error): break
}
Features
Waiting for your great pull requests :D
Try in Playground
This project contains a playground file. So you can try the features.
To try immediately, you can run the following:
$ cd <your working directory>
$ curl -sf https://raw.githubusercontent.com/tattn/SwiftRunner/master/scripts/try-playground.sh | sh -s
After building (⌘+B), you can try it :)
Requirements
Installation
Swift Package Manager
import PackageDescription
let package = Package(
name: "MyProject",
targets: [],
dependencies: [
.Package(url: "https://github.com/tattn/SwiftRunner.git", majorVersion: 1)
]
)
Contributing
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
License
SwiftRunner is released under the MIT license. See LICENSE for details.
SwiftRunner
SwiftRunner can execute the string written in Swift on runtime.
How to use
Execute string as Swift
Features
Waiting for your great pull requests :D
Try in Playground
This project contains a playground file. So you can try the features.
To try immediately, you can run the following:
After building (⌘+B), you can try it :)
Requirements
Installation
Swift Package Manager
Contributing
git checkout -b my-new-feature
git commit -am 'Add some feature'
git push origin my-new-feature
License
SwiftRunner is released under the MIT license. See LICENSE for details.