Why the Swift Optional
Type?
Optionals Try to Solve this Problem: Can a variable point to nothing?
Some programming languages allow it, for which, nothing is represented by nil
, null
, etc. The next question is how to deal with a variable that’s pointing to nothing. Let’s see some…