Google News
logo
Swift - Interview Questions
What are some common features in Swift structures and Swift classes?
Some common features in Swift structures and Swift classes are as follows :
 
* Swift Structs and Swift classes can both define attributes for storing values and functions.

*
With init, both structures and classes in Swift can create initializers to set up their initial state ()

*
They can be extended using extensions.

*
They can follow protocols, such as those used in Protocol Oriented Programming.

*
They can collaborate with generics to create types that are adaptable and reusable.
Advertisement