Basic Swift syntax (1): Basic swift syntax
Swift is a new programming language used to write iOS and OS X applications. Swift combines the advantages of C and Objective-C and is not limited by C compatibility. Swift adopts a secure programming mode and adds many new features, which makes programming simpler, more flexible, and more interesting. Swift is based on mature and popular Cocoa and Cocoa Touch frameworks and will redefine software development. Swift, released by Apple at the 2014 WWDC (Apple Developer Conference), can run with Objective-C on Mac OS and iOS platforms to build applications based on the Apple platform.
Swift is an easy-to-learn and easy-to-use programming language, and it is also the first system programming language with the same performance and fun as the scripting language. Swift's design is based on security to avoid a variety of common programming error categories.
In December 4, 2015, Apple announced that its Swift programming language is now open source code.
It is convenient to use Playground when learning the Swift syntax. Input on the left and value on the right.