Ten years ago, in July of 2010, Chris Lattner created a folder on his computer called
Shiny, and a new computer language was born. Four years later, in 2014, that language, renamed Swift, was introduced to the public, and was greeted with a mixture of surprise and excitement β and skepticism.
A complete Swift command is a statement .
A Swift text file consists of multiple lines of text. Line breaks are meaningful. The typical layout of a program is one statement.
var greeting = "Hello, playground"
The print command provides instant feedback in the Xcode console.
You can combine more than one statement on a line, but then you need to put a semicolon between them:
print("hello"); print("world")
Let in Swift is a constant to declare variables and cannot be reassigned.
Top comments (0)