Swift Definition

Swift Definition

Swift is a high-level programming language developed by Apple and made available in 2014. It is designed for writing apps for Apple platforms, including macOSiOS, tvOS, and watchOS.

The Swift language is based on Objective-C, which was used for NeXTSTEP development in the 1980s, and later macOS and iOS. Swift has similar syntax and maintains the object-oriented features of Objective-C, but provides a more simplified programming experience. For example, Swift code is easier to read and write than Objective-C. It allows several common commands to be combined and does require semicolons (;) at the end of each statement.

Additionally, Swift handles several programming obstacles automatically. For example, Swift:

  1. initializes variables before they are used
  2. handles “nil” (NULL) values explicitly
  3. ensures array indices are in bounds
  4. prevents integers from overflowing their allotted memory
  5. manages memory automatically

Apple’s Xcode software development IDE has supported Swift since version 6 (released in 2014). Xcode also supports “Swift Playgrounds,” a feature that allows programmers to edit Swift code and see the results immediately. For example, the playground may display the source code on the left and an app simulator on the right. Changes to the code update the app simulation on-the-fly. Several playgrounds are included with Xcode to provide an easy way to learn the language.

Since Apple develops and maintains the Swift language, it is optimized for Apple hardware. Therefore an iOS app developed in Swift may perform better than a similar app developed in another language. Apple also updates Swift with new features on a regular basis. This allows developers programming in Swift to take advantage of the latest advances in MacsiPhonesiPads, and other Apple products.

File extension: .SWIFT