Good to know and keep in mind. I usually only need some constant Int
or String
, so it's no problem, as static stored or computed property of constant generate the same code. I wish the compile can analyze the code at hand and suggest replace with computed property if appropriate.
We could add private global var
fileprivate let xxx = 123
is this not good enough?