Features of Swift Programming
Features of Swift:
1. Type inference: Swift can automatically deduce the type of a variable or constant, based on the initial value.
2. Generics: Generics allow us to write code only once to perform identical tasks for different types of objects.
3. Collection mutability: Swift does not have separate objects for mutable or non-mutable Containers. Instead, you define mutability by defining the container as a constant or variable.
4. Closure syntax: Closures are self-contained blocks of functionality that can be passed around and used in our code.
5. Optional: It defines a variable that might not have a value.
6. Switch statement: The Switch statement has been drastically improved. This is one of my favourite improvements.
7. Tuples: Functions can have multiple return types using tuples.
8. Operator overloading: Classes can provide their implementation of existing operators.
9. Enumerations with Associated Values: In Swift, we can do a lot more than just define a group of
Related values with enumerations.
10. Protocols and Protocol-Oriented Design: Apple introduced the Protocol-oriented Programming
Paradigm with Swift version 2. This is a new way of not only writing applications but also changing how we think about programming.