Swift Tutorial
Swift is an open-source programming language that supports multiple programming paradigms and is compiled. Apple released it at WWDC (Apple Worldwide Developers Conference) in 2014, for developing iOS, OS X, and watchOS applications.
Swift combines the advantages of C and Objective-C and is not restricted by C compatibility.
On Mac OS and iOS platforms, Swift can use the same runtime environment as Objective-C.
On June 8, 2015, Apple announced at WWDC 2015 that Swift would be open source, including the compiler and standard library.
Who is this tutorial for?
This tutorial is suitable for programmers who want to work on mobile (iPhone) development or OS X applications; it is better if you have some programming background.
All examples in this tutorial are developed and tested based on Xcode 8.2.1 (Swift 3.0.2 syntax).
Your First Swift Program
Of course, the first Swift program starts with outputting "Hello, World!", as shown in the following code:
Example Analysis
-
var myString = "Hello, World!": Use the var keyword to define a variable myString with the value Hello, World!
print: Output the value of the variable