Quantcast
Channel: November 2015 – Michael Tsai
Viewing all articles
Browse latest Browse all 70

Swift init()

$
0
0

Krzysztof Zabłocki:

With Swift strong typing and immutability, there are rules that prevent you from accesing variables until an object is fully initialized.

I do not like having a function do more than one thing, so I like to split my initializers into multiple functions, this becomes problematic.

[…]

We can define private static functions and use that to setup our variables (and we can also put them into private class extension)[…]


Viewing all articles
Browse latest Browse all 70

Trending Articles