Google News
logo
Swift - Interview Questions
In Swift, what does the init() method do?
The process of preparing an instance of an enumeration, structure, or class for use is known as initialization. Initializers are also used when a new instance of a type is created. An initializer is a no parameter instance method. The init keyword can be written using the initializer. Their primary role is to ensure that new instances of a type are correctly initialized before they’re used for the first time.
 
Its syntax is given below :
init()
{
// New Instances are initialized here
}
Advertisement