An Optional is a type that denotes a variable that may have a value or may be nil. Optionals are a crucial part of Swift and have been present since its initial versions. The following code example initializes a string named βnameβ and prints its value: How to Unwrap Optionals?…