+ 2

In swift what is the need of named types?

For ex: var name: String name="Hello" print(name) //Hello And also, var name="Hello" print(name) //Hello Both results in same output know..!!

13th Apr 2020, 7:57 AM
sarada lakshmi
sarada lakshmi - avatar
2 Respuestas
0
Named types assures the var to be the type you specified. It is like Typescript's aspect to javascript. Generally it is used in function paramaters to make sure right paramater type is passed
13th Apr 2020, 1:44 PM
Talha Altınel (The Last Sith Lord)
Talha Altınel (The Last Sith Lord) - avatar
+ 2
Thanks bro👍
13th Apr 2020, 1:47 PM
sarada lakshmi
sarada lakshmi - avatar