Get An Introduction To Swift Programming Language

Introduction to Swift 3.0

Swift is a programming language which was introduced by Apple in WWDC 2014. You must be aware that Apple uses Objective-C as its native language to develop iOS apps (or OS X, watchOS, tvOS). Swift is a general purpose, multi-paradigm, compiled programming language. Apple has its own framework to develop apps, named Cocoa and CocoaTouch.

History of Swift

The development of Swift was started in 2010 by Chris Lattner.  Swift is inspired by Objective-C, C, Rust, Haskell, Ruby, Python, C# and CLU (as per Wikipedia). On June 2, 2014, Apple WWDC became the first to release an app totally written in Swift. Apple has also introduced a bridging technique, which lets you convert your existing Objective-C source code into Swift. Swift won first place for Most Loved Programming Language in Stack Overflow Developer Survey 2015. Google is also considering using Swift as its first language for an Android.

Basic Swift syntax 

While writing Swift code, we follow Camelcase convention to declare the variables. Unlike Objective-C, Swift is an independent language and it has no similarity with C (i.e. Swift is not a superset of C). Swift statement doesn’t need a semicolon(;) to end but it doesn't matter if you add a semicolon at the end of a statement. 

Swift doesn’t need any main() method to start its execution.

New features of Swift 3.0
  • All most keywords can be used as the argument's labels.
  • Remove the ++ and – Operators.
  • Remove the C-Style for the loops with the conditions and the increment.
  • Tuples Comparison Operators.
  • Replace type alias keyword with the associated type for the associated type declarations.
  • Swift language version builds the configuration checkup system.
  • Naming functions with the argument labels.
  • Referencing the objective C selector of a method.
  • Modernizing Swift debugging identifiers.
  • Removing carrying function declaration of the syntax.
  • Removing var keyword for the function's parameters.
  • Migrate project Swift 2.2 to Swift 3.0.
Ebook Download
View all
Learn
View all