May 11, 2015:  ~ 45 sec read

Swift inferred types

I read this a while ago, and I just love doing this:

view.backgroundColor = .red
view.backgroundColor = .custom

formatter.locale = .autoupdatingCurrent

label.font = .withSize(15)
label.font = .customFont(ofSize: 15)

If only the compiler would offer proper autocomplete ... But, hey, at least it's faster and/or easier sometimes.

Subscribe to my monthly newsletter.
No spam, unsubscribe at any time.