100 Days of SwiftUI β Day 2
Nathan Mattes
Posted on May 22, 2020
The second day of a hundred took me like 20 minutes. Today's topics were more complex data types: arrays, dictionaries, tuples and enums and when to use each of them.
I learned, that you can provide a default
-value when accessing a dictionary using subscript(_:default:)
. When there's no value assigned to the key, you get your default
-value back. And although I don't use enums with associated values very often, it was nice to be reminded about them.
At UIKonf 2020, Conrad Stoll gave an interesting talk about state driven development using enums in Swift, so one day, these associated values might come in pretty handy. Here're some sketchnotes of the talk.
Posted on May 22, 2020
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.