Tag Archives: init

init method simple example swift programming

init method simple example swift programming Example below shows use of init method. It is used for initialization of the structure,class or enumeration property. In swift, we must initialise the properties before using them. So either you can do it while declaring them if they are not going to change for all instances. In case,… Read More »

Initializers swift programming

Initializers swift programming A member inside the class has to be initialized in swift. If not then it will produce an error. It can be done using init() function. Assign values to members when object is created and use deinitializer to perform clean up using deinit()