Why create "Implicitly Unwrapped Optionals"?

Answer

For example why is this:

let someString:String! = "this is the string";
going to be more useful vs:

let someString:String = "this is the string";
If “optionals indicate that a constant or variable is allowed to have 'no value'.” But “sometimes it is clear from a program’s structure that an optional will always have a value, after that value is first set” What is the point of making it an optional in the first place? If you know an optional is always going to have a value... Doesn't that make it.... not optional?

All swift Questions

Ask your interview questions on swift

Write Your comment or Questions if you want the answers on swift from swift Experts
Name* :
Email Id* :
Mob no* :
Question
Or
Comment* :
 





Disclimer: PCDS.CO.IN not responsible for any content, information, data or any feature of website. If you are using this website then its your own responsibility to understand the content of the website

--------- Tutorials ---