Optional
is an enum
with two cases, none
, and some(wrapped)
:
enum Optional<Wrapped> {
case some(Wrapped)
case none
}
As you can see, the Optional
either has a value of Some
, with an associated value (the value the Optional
wraps), or None
. Optional.None
is actually the meaning of nil
.
In this case, the debugger is telling you that someString
is an Optional<String>
(a.k.a. String?
), which has a value of Optional.Some("Hello Jupiter")
. It's not Optional.None
, thus it's not nil
.
Prior to Swift 3, these cases were capitalized, Some
and None
.