Swift inferred types

45 sec read

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.