Swiftpack.co - krzyzanowskim/OnlineSwiftPlayground as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by krzyzanowskim.
krzyzanowskim/OnlineSwiftPlayground swift5_1
Online Swift Playground
⭐️ 219
🕓 3 days ago
macOS linux macOS iOS
.package(url: "https://github.com/krzyzanowskim/OnlineSwiftPlayground.git", from: "swift5_1")


Platform Twitter

Online Swift Playground. Implemented in Swift.

TBA. Checkout http://SwiftPlayground.run


Installation & Run

$ git clone https://github.com/krzyzanowskim/OnlineSwiftPlayground.git
$ cd OnlineSwiftPlayground
$ ./run.sh

The run.sh script will generate Xcode project (on macOS) and bootstrap the environment. run.sh needs npm to be installed to work properly. Bootstraping involves

  1. Download Swift Toochains supported by the playground
  2. Pre-build support module using the toolchains
  3. Install dependencies
  4. Launches web server on localhost on port 8080

Now you could access playground pointing web browser to



Generate Xcode project

$ swift package generate-xcodeproj


Web user interface is build with React and webpack.

$ npm run build



Download the latest image:

$ docker pull krzyzanowskim/onlineswiftplayground

or build docker image by yourself:

$ git clone https://github.com/krzyzanowskim/OnlineSwiftPlayground.git
$ cd OnlineSwiftPlayground
$ docker buildx create --use
$ docker buildx build --platform=linux/amd64,linux/arm64 . -t krzyzanowskim/onlineswiftplayground

then run container:

$ docker run -d -p 8080:8080 --name onlineswiftplayground -t krzyzanowskim/onlineswiftplayground

and wait until docker container is up (usually several seconds).

Playground is available at http://localhost:8080. If the docker setup uses VirtualBox, the you can get the IP address from docker-machine ip command.

$ open http://$(docker-machine ip):8080


Third party frameworks should be copied to Frameworks directory (Frameworks are for macOS host only)

See config/ for GitHub auth. sample config.


SwiftPlayground.run is owned and maintained by Marcin Krzyzanowski

You can follow me on Twitter at @krzyzanowskim for project updates and releases.


Creative Commons Attribution Non Commercial 4.0. See LICENSE file.


Stars: 219
Last commit: 3 days ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Release Notes

3 days ago

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics