Introduction to the Swift language tutorial
Swift is an open source programming language that supports the multi-programming paradigm and compilation, and Apple released the WWDC (Apple Developers Conference) in 2014 to develop iOS, OS X, and watchOS applications.
Swift combines the benefits of C and Objective-C and is not limited by C compatibility.
Swift can use the same operating environment as Object-C on Mac OS and iOS platforms.
On June 8, 2015, Apple announced on WWDC 2015 that Swift would be open source, including compilers and standard libraries.
Who is fit to read this tutorial?
This tutorial is suitable for programmers who want to work on mobile (iPhone) development or OS X applications, if you have a programming foundation that is better before.
All instances of this tutorial are tested based on Xcode7.1 (Swift 2.x syntax format).
The first Swift program
The first Swift program certainly starts with the output "Hello, World!" and the code looks like this:
/* 我的第一个 Swift 程序 */ var myString = "Hello, World!" print(myString)