Open In App

Swift Programming Language

Swift is a general-purpose, multi-paradigm, object-oriented, functional, imperative, and block-structured language. Swift is the result of the latest research on programming languages and is built using a modern approach to safety, and software design patterns by Apple Inc. for iOS applications, macOS applications, watchOS applications, tvOS applications. 

Swift is easy to learn, easy to implement, safe, fast, and expressive. Developing Swift in the open has its exciting aspects as it is now free to be ported across a wide range of platforms, devices, and use cases.

The features of Swift are designed to work together to create a powerful language. Additional features of Swift include: 
 

Memory Management: Automatic reference counting is a system which tracks the number of references to an object in memory. When an object is no longer needed in the future , ARC automatically deallocates the memory used by that object. This helps to prevent memory leaks, which can occur when an object is no longer needed but its memory is not released, and can help to improve the  performance of the program.
Swift is managed as a collection of projects, each with its repositories. The current list of projects include: 

Example:  




// Basic Swift Program
import Foundation // This functionality provides basic functionality to apps
  
var str1 = "Hello geeks!"
let str2 = "How are you?"
print (str1)
print (str2)

Output: 
 

Hello geeks!
How are you?

Run: Code can be tested on Online IDE for Swift 

Note: Import statement is used to import any objective-C framework or library directly into Swift program. 
var keyword is used for variable and let keyword is used for constant. There is no need for”;” for termination, in case the programmer uses it compiler won’t show an error. 

Advantages – 

Disadvantages:

Article Tags :