Hacker News new | ask | show | jobs
by PabloSichert 3249 days ago
Currently starting to build a native macOS/iOS/watchOS productivity app, therefore picking up Swift.

I'm coming from web development - and feel a bit stuck on how to layout things with Xcode / Swift. I'm not convinced by the graphical way to build interfaces provided by Interface Builder / Storyboards, as they feel quite limited in terms of precise control, dynamic layout, no duplication and use with VCS.

Optimally there would be something like React to build interfaces declaratively.

Does anyone have some insight into this topic?

(Also: why are variable declarations so implicit in Swift? When importing a package all its exported variables are avaliable within the file, making code really hard to read in my opinion.)

1 comments

You can build your UI programmatically and not touch storyboards/xibs. A lot of people do this and I am slowly moving away from IB myself. This library has been recommended for doing autolayout:

https://github.com/nakiostudio/EasyPeasy