Swift! Optionals? A short guide. (And one trick)

Fri, 04/14/2017 - 11:28

If you are coming from Objective-C or you are new to swift. Optionals can be tricky to understand, but once you do they wont get in your way anymore.

Optionals are defined in properties of a Struct or Class, or method parameters. They are defined by following Type definition (Int, or String, or [String]) with a question mark, "?".