
Swift, an open source programming language that supports multiple programming paradigms and compilation, was released by Apple in 2014 at the WWDC (Apple developer Conference) for the development of iOS,OS X and watchOS applications.
Swift combines the advantages of C and Objective-C and is not limited by C compatibility.
Swift can use the same runtime environment as Object-C on Mac OS and iOS platforms.
On June 8, 2015, Apple announced on WWDC 2015 that Swift will open source code, including compilers and standard libraries. This tutorial is suitable for programmers who want to work on mobile (iphone) development or OS X applications, preferably if they have a programming foundation before. All examples of this tutorial develop tests based on Xcode8.2.1 (the syntax format of Swift 3.0.2). The first Swift program, of course, outputs “Hello, World!” To begin, the code is as follows: Case analysis Swift official manual Swift Chinese Manual (5.0) 9.1.1. Who is suitable for this tutorial? #
9.1.2. The first Swift program #
Example #
/*My first Swift program*/varmyString="Hello, World!"print(myString)
var
myString
=
"Hello,
World!"
use the var keyword to define a variable myString with a value of Hello, World!
print
: The value of the output variable 9.1.3. Related materials #