Optionals can be difficult to understand. I remember when I first encountered them while converting a project to Swift I just did what Xcode told me to do without really understanding why. In this post, you'll not only get a good understanding of how optionals work, but you'll also learn about "if let" and guard.
An optional is nothing more than an enum with two cases: .some and .none. When your optional holds an object, the .some case has an associated value, when it does not, the .none case indicates your optional is nil.
Optionals are not Optional by Zack F