Settings

Theme

An open source library for laying out iOS user interfaces.

charlesmchen.github.com

66 points by charlesmchen 14 years ago · 5 comments

Reader

nodemaker 14 years ago

I think this way of laying out subviews is a functionally incomplete approach and it more often than not makes you write more code than it really abstracts.

To be honest this is in fact one reason most iOS developers dont like Android or Java Swing.Because what really happens is that you think of something really cool and then you realize that its not really linear or grid or rectangular or even box.At that point learning how to layout subviews with co-ordinates is too much work and you just go with a shitty box layout instead.This has happened to me so many times while using java swing that I am now (wrongly) biased against java for life.

For example what if I want to layout my subviews in a circular fashion around the centre of the parent view.Or what if my subviews are cards which are seperated from the previous card with exponentially increasing distances.

On iOS the simple way to layout subviews is by quite simply setting their frames relative to the frame of the parent view in the layoutSubviews method.To take care of different screen sizes and orientations all you have to do is the set the autoresizing mask correctly.Thats it!

That's like seven lines of code for three subviews and it is functionally complete.

blueprint 14 years ago

This is a neat concept, but like nodemaker I have to point out that it has some limitations in terms of what sort of interfaces it can make.

Additionally, in order to make use of this tool, you still need to be a programmer, and if you are a designer or someone who has ideas and no programming knowledge, you cannot use it. This is one major reason I launched my company, Blueprint - https://blueprint.io - not only can you lay out your highly customized app visually like this (except, by pixel, if you'd like) but it actually handles the entire build process for you and lets you download and submit it to the store.

Thanks for sharing! Hope to see this tool develop in the future. If I could add one request it would be to have some way to iteratively or procedurally lay out views.

RandallBrown 14 years ago

Interesting. Some of the grid views seem like they could be really useful, as does the automatic orientation stuff.

It seems like this should play nicely with interface builder still also. I couldn't give up IBActions and IBOutlets.

An interesting next step would be take take your sample project and make it into it's own sort of Interface Builder that would generate the objective-c to programmatically build those views. That would be pretty cool.

  • charlesmchenOP 14 years ago

    Thanks for the comment.

    Yes, the WeViews are just UIView and play nicely with IB.

    Also, the demo _does_ generate code for the layouts you build in it. Unlike IB, its just pseudo code; it lacks specifics and just contains the layout logic. It also doesn't (yet) let you re-open and edit past layouts. But it certainly lets you build UIs visually/interactively.

hobonumber1 14 years ago

I was very impressed by the demo. The comments below re. integration with Interface Builder is justified but its still impressive. Thanks for open sourcing this!

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection