Learn Swift Programming Language on Windows OS using Swift IBM Sandbox

Update - IBM discontinued Swift Sandbox. Alternatively, now you can run Swift natively on Windows 10 using WSL. Here the complete guide to run Swift on Windows.

The IBM Swift Sandbox is an interactive website that lets you write Swift code and execute it in a server environment – on top of Linux! In addition, both the latest versions of Swift and its standard library are available for you to use.

We know you're as excited as we are to start using this tool, so please bear with us during the initial launch of the sandbox. With that in mind, let's get started!

Hello world!

To begin, let's write a simple Swift program together. In the left window labeled source code, enter the following line of code:

print("Hello world!")

Hit the blue play button located at the bottom to execute the program. If everything was entered correctly, "Hello world!" should appear under output in the results window.

If we edit the previous example and omit the closing parenthesis at the end of the line, an error should get flagged by the editor. Hover over the red marker that appears next to the line number to examine the error message. Error messages are also listed in the output.

Change the Swift Version

IBM Swift Sandbox provides latest stable and development versions of Swift. You can change the Swift Version from Setting Option available in bottom right.

Save Code

You can save your code by copy-paste in your personal computer. Also, IBM Swift Sandbox provide an option to save your code on cloud. You can save your code using option "Save Code" available in bottom bar.

Fill the program name in the form. You can also provide additional details.

After clicking Save you will have the option to share via link or social media. You can also save this link for future reference. You can access same code by using this link or send your code link to a friend.

Next - Introduction to Swift


You've successfully subscribed to Developer Insider
Great! Next, complete checkout for full access to Developer Insider
Welcome back! You've successfully signed in
Success! Your account is fully activated, you now have access to all content.