What is Swift
Swift is a multi-paradigm, general-purpose, open-source programming language for iPadOS, macOS, tvOS, watchOS, and
iOS development.
The language is influenced by Python, making it fast and intuitive. Swift is mainly used for native iOS and macOS development.
Many popular apps including LinkedIn, Lyft, and WordPress are written in Swift. It was created by
Apple in 2014 to give developers a powerful language to develop iOS apps. It’s intended to be a replacement for C-based languages. The Swift language is constantly evolving, and the community continues to grow. Swift source code can be found on GitHub, making it easy for anyone to access the code.Swift was designed to be
easy to learn and easy to use. Apple created the language with
new coders in mind. Whether you’re still in school, exploring a new career path, or wanting to learn how to code, Swift was created to be a simple and
intuitive first language to learn. If you’re new to coding, Swift Playgrounds is an iPad app that makes it easy to get started with Swift coding.
To achieve this goal, the most obvious way to write Swift code must also be:
Safe. The most obvious way to write code should also behave in a safe manner. Undefined behaviour is the enemy of safety, and developer mistakes should be caught before software is in production. Opting for safety sometimes means Swift will feel strict, but we believe that clarity saves time in the long run.
Fast. Swift is intended as a replacement for C-based languages (C, C++, and Objective-C). As such, Swift must be comparable to those languages in performance for most tasks. Performance must also be predictable and consistent, not just fast in short bursts that require clean-up later. There are lots of languages with novel features — being fast is rare.
Expressive. Swift benefits from decades of advancement in computer science to offer syntax that is a joy to use, with modern features developers expect. Once you learn Swift, you’ll be an appealing candidate for potential employers.
A simple Hello World program in the Swift programming language:
// Swift "Hello, World!" Program
print("Hello, World!")