News for hackers. Stuff that matters.
Re:Reducing the size of iOS app binaries by goblin89 on Friday June 23, 2017 @03:05AM (#14617463)
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

[1] https://github.com/robb/Cartography

Re:Reducing the size of iOS app binaries by DerekL on Friday June 23, 2017 @03:35AM (#14617549)
> 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).

Re:Reducing the size of iOS app binaries by sandofsky on Friday June 23, 2017 @03:33AM (#14617541)
Layout 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.

Re:Reducing the size of iOS app binaries by jimboj on Friday June 23, 2017 @04:33AM (#14617763)
I 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.