
Mike walks us through Optionals & gives us a specific code example. Plus we launch a new segment long in the making, “Mike Was Right” & it’s a doozy!
RSS Feeds:
MP3 Feed | Video Feed | Torrent Feed | iTunes Audio | iTunes Video
Become a supporter on Patreon:
— Show Notes: —
Optionals
Swift 4 also introduces Optionals type, which handles the absence of a value. 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. It has two possible values, None and Some(T), where T is an associated value of the correct data type available in Swift 4.
- Gist
- What are they and why you should use them
- How they are used in Swift
- String v String? – different types
- Sort of an implicit nil check
- What is “forced unwrapping”
-
Optional Binding
‘Optionals’ in other languages
Checking out #googlehome mini pic.twitter.com/cuLm9047El
— Michael Dominick (@dominucco) October 22, 2017
After the end of the startup era
The web boom of ~1997-2006 brought us Amazon, Facebook, Google, Salesforce, Airbnb, etc., because the Internet was the new new thing, and a handful of kids in garages and dorm rooms could build a web site, raise a few million dollars, and scale to serve the whole world. The smartphone boom of ~2007-2016 brought us Uber, Lyft, Snap, WhatsApp, Instagram, Twitter, etc., because the same was true of smartphone apps.
Do you have the Learners Syndrome?
If I start building something and investing time in it, I feel like I’m missing out on learning the new cool technologies and have a fear of being left behind.