Speeding Up Slow Swift Build Times
Nick O'Neill ☎️ 🇺🇸
1215

Interesting post. I have a project which takes too long to compile too. Found some issues of my own using this technique. I have for example subclassed UITextField where I’m overriding intrinsicContentSize(). On the first line I do:

if isFirstResponder() {

Result: 4929.3ms CMExpandingTextField.swift:18:19 @objc override func intrinsicContentSize() -> CGSize.

That’s 5 seconds for one line of code. I’m sure I can find other places where it gets stuck too.