Dealing with a static cling in Swift

As programmers we often have to deal with legacy code, usually not written by us, sometimes of bad quality, without unit tests, hard to modify, with high regression risk. One of ubiquitous code smells is so called static cling. It is so frequent because lots of developers “love” static functions, singletons and in fact greatly abuse those patterns.
We do so, because static code seems easier and faster to write, but in a longer run, the code written using those patterns is hard to test, not reentrant, coupled, maintaining global state and is just badly designed.

Read More

Taming Swift compiler bugs

Xcode 7.2 has a bug which results in compilation failure of project having +1500 Swift files. It seems that swiftc is buggy, but you can try to bypass that behaviour by using my wrapper script. Read the whole post if you are interested in what happens under the hood.

Read More