Hacker News new | ask | show | jobs
by tomyws 3753 days ago
I find it strange that something akin to markdown-style syntax sugar is more user-friendly than a visual designer. Do the tools for developing a UI for iOS this way not include a WYSIWYG editor to set things such as contraints?
7 comments

The tools do include that functionality, called Interface Builder or the Storyboard Designer.

The editor on its own is fairly nice to use these days, but it outputs obtuse XML and has a propensity to edit parts of the layout XML file that weren't actually modified. This makes source-control level collaboration and especially code review very difficult. To make things worse, for a long time the tooling encouraged putting almost all UI into one giant "Storyboard XML" file, guaranteeing confusion and conflicts.

The editor was also quite slow and crashy for years which drove the proliferation of these libraries and the "don't use the storyboard editor" meme accompanying them. It's gotten a lot better in the last ~2 years and I haven't had a crash in heavy day-to-day usage for quite some time.

If Apple could improve the XML output format to be easier to review, eliminate the serialization/deserialization weirdnesses, introduce a visual diff-and-merge tool, and improve the performance just a bit more, the Interface Builder would be excellent, but as is, I see why a lot of people don't like using it, especially on big projects with many collaborators.

They do, but search and replace, diffing, and copy-paste of multiple elements and their constraints likely (I haven't used Xcode's editor much, certainly not recently) do not work as well as their equivalent in text.

And of course, some people find markdown more user-friendly than a visual GUI for more or less the same reasons, so it should not be that surprising to find some people experiment with this.

And of course, autolayout has a text-based language of its own (https://developer.apple.com/library/ios/documentation/UserEx...)

you can copy elements in interface builder, iirc. you can't copy their constraints, which makes sense because the copied instances necessarily have different constraints. otherwise the copies would just stack on top of each other.

in my personal opinion, IB is great for layout of one view or screen, especially with the new IBDesignable and IBInspectable features.

doing app navigation in a storyboard is a terrible idea and will lead to a monolithic storyboard file that is very annoying to work with.

Was going to say something similar, that IB is great if you are doing one-off screens, but it isn't the best for creating reusable / composable UI elements.
couldn't agree more !
I think it's really a question of audience. A textual DSL for visual layout is popular to the HN audience, because most of us are more comfortable writing code and interacting with computers on the command line. While we love having a DSL that we can use our favorite tools on (like diff, grep, ack, etc.), the majority of other folks (read: non-HN users) probably find a WYSIWYG editor much nicer.
Using Interface builder is Great indeed it just has a ton of other issues down the road, this article sums it well : http://blog.teamtreehouse.com/why-i-dont-use-interface-build...
They do in the interface builder however if you just wanted to use programmatically created views then not really no.
I find XCode's UI editor pretty good!
Do you also find it strange that WYISWYG website editors are not more widely used?