What is Swift?

What is Swift?

Introduction to Swift

giphy (8).gif

Swift is a general purpose, multi-paradigm, compiled programming language for developing iOS and OS X tvOS, and watchOS applications. Apple Inc develops it. It is a powerful and intuitive language that is easy to learn. Swift code is safe, precise, and runs very fast.

Swift 5 is the latest version of Swift which inbuilt the features of Swift 4 and enhanced the language's robustness and stability.


Prior to Swift

Prior to Swift coming into the picture, Objective-C was used to develop mac and ios apps.

Objective-C is the primary programming language you use when writing software for OS X and iOS. It’s a superset of the C programming language and provides object-oriented capabilities and dynamic runtime. Objective-C inherits the syntax, primitive types, and flow control statements of C and adds syntax for defining classes and methods. It also adds language-level support for object graph management and objects literals while providing dynamic typing and binding, deferring many responsibilities until runtime.

History of Swift

giphy (9).gif

Swift was introduced in 2014 at Apple's Worldwide Developers Conference.

The development of Swift was started in 2010 by Chris Lattner with other programmers i.e. Doug Gregor, John McCall, Ted Kremenek, and Joe Groff at Apple.

Swift was inspired by Objective-C, Rust, Haskell, Ruby, Python, C#, CLU, and many other programming languages.

Swift's first version was 1.0 which underwent a major upgrade to Swift 2 at WWDC 2015.

Its upgraded version 2.2 was made open-source software under the Apache License 2.0 on December 3, 2015, for Apple's platforms and Linux.

VersionsRelease Date
Swift 1.0September 9, 2014
Swift 1.1October 22, 2014
Swift 1.2April 8, 2015
Swift 2.0September 21, 2015
Swift 3.0September 13, 2016
Swift 4.0September 19, 2017
Swift 4.1March 29, 2018
Swift 4.2September 17, 2018
Swift 5.0March 25, 2019
Swift 5.1September 10, 2019
Swift 5.2March 24, 2020
Swift 5.3September 16, 2020
Swift 5.4April 26, 2021
Swift 5.5September 20, 2021
Swift 5.6March 14, 2022
Swift 5.6.3September 2, 2022 (latest🚀)

Features of Swift

giphy (7).gif

  1. Swift follows the Objective-C like syntax.

  2. Swift is an Open Source Programming Language.

  3. Swift is one of the fastest general-purpose languages.

  4. Swift provides an easy way to write iOS and OS X apps.

  5. Swift provides an enhanced set of modern programming features.

  6. Swift has more performance features.

  7. Easier memory allocation and deallocation.

  8. Swift has access control like public, private, open, internal, and fileprivate.

Pros of Swift

giphy (10).gif

  1. Rapid development process.

  2. Easier to scale the product and the team.

  3. Improved safety and performance.

  4. Interoperability with Objective-C.

  5. Full stack potential and cross-device support.

  6. Vibrant open source community.

Cons of Swift

giphy (11).gif

  1. Swift is considered a “moving target”.

  2. Limited talent pool.

  3. Lack of support for earlier iOS versions(Prior to ios7).

Pre requisite to learn Swift

  1. Any Apple Computer

  2. XCode (IDE to write code)


How is Swift programming language different from Objective C?

  1. Safer type system, (e.g. no nil outside of Optional)

  2. Mutability is discouraged, (but still possible if required)

  3. Type inference

  4. No headers

  5. Better support for concurrency

  6. Easier to learn & easier to maintain

  7. Much better support for the functional programming paradigm

  8. More powerful enum types

  9. Reference compiler is open-source and development is done in the open

  10. Playgrounds, (code is executed as you type is)

  11. Linux support

Important Websites:

giphy (12).gif

Official Website for Documentation and Resources: https://www.swift.org

Swift Source Code: https://www.swift.org/source-code

Follow for more

Linkedin: https://www.linkedin.com/in/prahladinala/
Github: https://github.com/prahladinala/
Instagram: https://instagram.com/prahlad.inala/
Twitter: https://twitter.com/prahladinala
Figma Community: https://www.figma.com/@prahladinala
Dribbble: https://dribbble.com/prahladinala
Behance: https://www.behance.net/prahladinala
Personal Portfolio: https://prahladinala.in
ToolMate: https://toolmate.co.in

Thank you!

Did you find this article valuable?

Support Prahlad Inala by becoming a sponsor. Any amount is appreciated!