Taken by the Swift

swift

Swift is here to stay

This post was inspired by a one day Swift crash course. I have to tell you that Swift is a very nice language with impressive syntactic structures that turn iOS/ OS X development into very joyful experience in comparison to Objective C.

What is also very encouraging about Swift that its core is opened source by Apple and the source code is available at GitHub. In addition, development in Swift is now possible not only under OS X, but also on Linux (Ubuntu). It is also possible to develop in Swift on Widows with OS X running under Virtual Machine, but about this later.

Current version of Swift is 2.2 and 3.0 is about to be ready later this year (2016).

Introduction from Swift.org site

About Swift

Swift is a general-purpose programming language built using a modern approach to safety, performance, and software design patterns.

The goal of the Swift project is to create the best available language for uses ranging from systems programming, to mobile and desktop apps, scaling up to cloud services. Most importantly, Swift is designed to make writing and maintaining correct programs easier for the developer.

Playground

1. IBM Swift Sandbox

There are a number of ways to start playing with Swift. The most generic one is to use IBM Swift Sandbox web site for this matter. It makes it possible to try Swift out without buying Mac or installing VM with OS X/Ubuntu or installing Ubuntu itself.

OK. When you are at the site what you see is REPL running on Linux. And it looks just like this. And it’s kind of interpreter for Swift.

ibm_santbox

 

 

2. Swift on Linux (Ubuntu)

Currently Swift is supported on Ubuntu 14.04 and 15.10. In order to play with Swift on Ubuntu please follow very detailed how to guide from official Swift site here.

3. Swift on Windows in OS X Virtual machine 

As of today Swift is not supported on Windows so Windows users must use virtual machine running Ubuntu in order to be able to develop application in Swift. On the other hand one may develop natively in Swift with VM that runs OS X on it. To be able to do this please use this YouTube detailed tutorial.

Main steps are

  1. Install free VMware Workstation Player
  2. Download OS X image from the link in the tutorial description in YouTube
  3. Install VMware customization batch file.
  4. Configure VM and run OS X under it
  5. Create Apple account in order to be able to download XCode via App Store.

4. Swift on OS X with XCode (pretty expensive for those of us who have no Mac)

If you already posses a Mac then it is easy to install Swift in accordance with the steps below from official Swift site.

That’s it and stay tuned. 

Java Code Geeks