Swift Hello World Primer Tutorial

Swift Hello World Primer Tutorial

Swift Hello World Primer Tutorial

The last (and only) time we talked about Apple’s new programming language for iOS development, Swift, was in terms of learning a bit about the similar Rust language when we presented Rust Primer Tutorial as shown below, mainly because it was hard, then, at least for us, to track down much about the Swift language.

Things have moved on since, and with iOS 8.1 you can develop Swift based mobile applications totally with Swift, instead of Objective-C, and as with recent times of Objective-C iOS work the Storyboard has taken over as the default GUI arrangement in preference to the use of XIB files.

Today’s project is a Hello World project, so it is very simple, and, perhaps, unless you are well into Swift already, it is best to start simple and build up. With this in mind we model the Hello World project on the advice from Hello World Example in Swift (thanks) but please bear in mind that it ended up to be simpler in iOS 8.1 because we can pick a “Single View iOS Application” and use Storyboards, and lots of the AppDelegate.swift advice is no longer required to achieve, now, in iOS 8.1, with regard to what that tutorial sets out to achieve … and all that we aim to achieve today with the application Run today on an iPhone simulator and a real iPad device.

Don’t like to give up on Objective-C, but have to say, that by the end of a day of struggle, I can see and feel that there could be some good streamlinings lately in the organization of these Xcode iOS mobile projects in Swift … maybe Swift by name, and “pretty fast” by nature … chortle, chortle.

If you think “control drag” is no longer needed, though, think again … Mac laptop keyboard “control drag” was used to create the blue line links on this tutorial slide … “practice makes perfect”.

Here are two parts of the Swift code for our Hello World application you could call AppDelegate.swift and ViewController.swift

Hope you enjoy using Swift.


Previous relevant Rust Primer Tutorial is shown below.

Rust Primer Tutorial

Rust Primer Tutorial

The wind is still blowing. And they (that being a really tiny proportion of the populace, at large) are still calling the wind Mariah. Do you see those exhausted butterflies in Brazil flapping (a bit less than) faster?

Today we try out the programming language Rust, mainly because it has a lot in common with the upcoming iOS language Swift, and because Rust looks very powerful. Rust is an open source language that relies on a few prerequisites for installation. As we had these pre-requisites here, luckily, on this Mac laptop we did not have to wrestle with these issues (personally, I like the abominable stretch abdominal stretch (by Mario Milano) regarding “best techniques” here). Below are what this hugely useful link explains are the prerequisites for Rust usage:

  • g++ 4.7 or clang++ 3.x
  • python 2.6 or later (but not 3.x)
  • perl 5.0 or later
  • gnu make 3.81 or later
  • curl

So, today, we try a Hello World scenario in Rust. The motivation here is learning and preparation for future use of Swift for Xcode iOS 8 programming, perhaps. As they say in the boy scouts “be prepared”.

Here is the Rust programming source code used here, which you could call hellofromrjm.rs

Here is a link to a Rust home page.

Hope you get something out of today’s tutorial. We give thanks to the information of some of the links on this Google search for the leads here.

If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.

This entry was posted in eLearning, iOS, Tutorials, Xcode and tagged , , , , , , , , , , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *