Consider these two declarations:
var implicitUnwrappedOptionalInt: Int! = nil
var optionalInt: Int? = nil
The result would be nil
in both the cases. So what is the difference?
Consider these two declarations:
var implicitUnwrappedOptionalInt: Int! = nil
var optionalInt: Int? = nil
The result would be nil
in both the cases. So what is the difference?
An implicitly unwrapped optional can be (will be) initialized nil
BUT you are telling the compiler that it will be set to a value before you first use it. If you do try and use it before it is initialized like I do below, you will crash everytime.