Swift By Example - Hello World
Swift is a rich language that can be used for all sorts of apps, not just iOS or OSX GUI ones. We can make terminal apps just like we would with any other systems language like C++ or Java!
Let’s start off with a Hello World example!
What does Hello World look like? Open up your favorite editor and type this:
Save this as
To compile this, we can open up our handy Terminal, and type the following command:
Now we have a binary! To run it, type the following command in the same directory:
@UIApplicationMain in your
You can also run the app without compiling it by just running the following: