4 ms·
When I switched from web to iOS development, I did 99% of design programmatically because it is what I was used to (CSS). The only things that I used interface
by jathu 11y ago
When I switched from web to iOS development, I did 99% of design programmatically because it is what I was used to (CSS). The only things that I used interface builder was for segues. The frames of each element would be dependent on one another, so if I were to change the frame values of one element, it would adjust everything else accordingly, which was perfect.
However, doing things programmatically takes a long time, so much time wasted trying to align things in your head then implementing it. After talking to a friend who did iOS development for a long time, he convinced me to switch to interface builder. I couldn't be any happier. Firstly, all the elements are available visually, this is a big help to me and anyone else that looks at the project. Secondly, handling size and alignment in interface builder will be daunting initially, but once you get the hang out of it, it becomes extremely easy. The biggest advantage is the amount of time you save from not having to write code.
The author points out the negatives to interface builder, which is pretty important. Maybe iOS developers should start diving into the XML like Android developers.
- htormey 11y agoI've done android development as well as iOS development. The big difference is that the xml spat out by the android tools is readable and easily hand editable as opposed to the xml produced by interface builder. At the start of the article I make be point that interface builder is great for solo developers or small dedicated IOS teams. My main critique of interface builder is its use in a larger cross functional team setting. That doesn't sound like your use case. Re manual view layout: Have you looked at any third party libraries like masonry, snapkit or componentkit? When I worked at Facebook we used ComponentKit and it was a much better experience than manually calculating the positions of views.
- eridius 11y agoThe XML spit out by interface builder these days is pretty readable too. Have you looked at it in the past few years?
- htormey 11y agoYep, it's still pretty unreadable in my opinion.
- RyanZAG 11y agoIB XML is nothing like Android XML - they're world apart in readability. Trying to edit the IB XML directly is almost impossible -- I've tried. Honestly the best part of new tools like React Native is how it let's you get away from IB without the huge hassle of trying to declare your whole interface directly in objc/swift.
- htormey 11y agoThis^
- wtetzner 11y agoIt might be interesting to have an interface builder that output code, instead of XML.