Question: what are optionals in swift?
Answer: Optionals say either "there is a value, and it equals x" or "there isn't a value at all". An Optional is a type on its own, actually one of Swift 4's new super-powered enums. ... Optionals are similar to using nil with pointers in Objective-C, but they work for any type, not just classes.