4 ms·
For some non-obvious on-point tips regarding binary size and (also importantly) startup speed in complex apps, see ‘Swift with a hundred engineers’ (2016) where
by goblin89 9y ago
For some non-obvious on-point tips regarding binary size and (also importantly) startup speed in complex apps, see ‘Swift with a hundred engineers’ (2016) where Tuomas Artman shared what Uber engineering’s learned from their iOS rewrite[0].
Nit: advocating AutoLayout to me doesn’t seem to compute with avoiding libraries. Is it actually feasible to use AutoLayout in a larger-scale app without something like Cartography[1]? Interface Builder still feels quite buggy in this regard.
[0] HN discussion: https://news.ycombinator.com/item?id=14207752 https://news.ycombinator.com/item?id=14207752
[1] https://github.com/robb/Cartography https://github.com/robb/Cartography
- sandofsky 9y agoLayout Anchors in iOS 9 cut down the boilerplate required to initialize constraints programatically. The tricky part is remembering to turn off translatesAutoresizingMaskIntoConstraints. That said, if you decide to bundle a valuable library, it's not the end of the world. We got away with zero libraries, but we're very much an exception. The issue is that too many teams default to, "Yes, let's bundle this giant library," even they're dealing with a trivial problem. The default should be, "No," and you should have to argue for bloat.
- DerekL 9y ago> Is it actually feasible to use AutoLayout in a larger-scale app without something like Cartography? You can now do this: addConstraint(button1.rightAnchor.constraint(equalTo: button2.leftAnchor, constant: -12.0)) I think this is pretty compact and readable as it is. But it's only supported in iOS 9 and macOS 10.11 (right now, only one version back).
- jimboj 9y agoI have built many large scale apps and have never used a library for autolayout, it's just not necessary. Using visual format language helps cuts down the code a lot.