Tuesday, February 12, 2008

Interface Scrambler 3.0

... OK that's a tad unfair, but Interface Builder 3.0 is driving me crazy recently.
In general, the workflow and UI of V3.0 is significantly better than the prior incarnation (IMHO), but unfortunately 3.0 seems unfinished and rather buggy.

One of the biggest functional problems with IB3 IMO is the lack of a decent capability to reparent views - expect in simple cases. In the simple cases, you click and hold on a view in the spatial/layout designer. This "pops out" the selected view hierarchy, and you can then drag it to a new parent view. So far so good.

Any real interface however is likely to have containers like NSSplitViews and NSTabViews, and these seem to have special (arguably broken) editing rules.

For instance, I had created some prototype UI in a NIB a few days back, and had added an NSSplitView using the "Embed Objects In..." functionality, whereby you select two views, and IB3 adds the new container (split view) and putting each selected view as the child view each side of the split bar. So, creating these initially is no problem (at least in this bottom-up way).

I go on to make a considerable investment in time adding outlets, making connections, setting properties etc.
Then, when the prototype UI is working well enough, I realise I want to beef it up, to fill out the UI with other controls each side of the splitter. So, what I want to do is insert a new layer of views each side of the splitter, which will parent my existing UI and allow me to add adjacent views to that which already exists.

So, my first thought is "Embed Objects In..." again, selecting the current view snapped into one side of the splitter - and perhaps inserting a "Box" between the splitter and this view. But... no, when I select the view on one side of the splitter and go to the menu, it's all greyed out - no dice.

So, it occurs to me that my only option is to move the old split pane 'subview' out of the splitter, then add in the new 'box', then put the old view back onto this, as its new superview. OK, well, the way to reparent views, according to the IB3 manual, is to 'pop out' the child views as described earlier. However, it turns out that this doesn't work with split views. Apparently, they don't want to have an empty pane, so IB3 doesn't let you do this.

Suffice it to say, that I had to rebuild the split view from scratch, with a new custom view or box 'layer' in each side. Furthermore, copying and pasting view hierarchies appears to result in much of the set properties in the hierarchy being reset. The view hierarchy itself is preserved, but bindings and attributes are all lost - a considerable cost in time and frustration to recreate exactly.

I would dearly love to be able to reparent views in the NIB outline window rather than the layout window, but there's no support for this at all.

Other sundry issues I've experienced:
- Setting a new binding on a view deselects the view you're working with and effectively defocuses the inspector you're working in.
- If you set names on some views (Scroll views and Outline views I tried today) they are not saved (or if they are, then they're reset when the NIB is reloaded).
- Occasionally I have had other properties reset (often bindings)
- IB3 can get into a state where it refuses to 'see' a view in the NIB file overview (hierarchy view) and/or the inspector - whereas the view is clearly 'there' in the layout window.

I've wondered if some of this is down to the flavour of NIBs I've been using (Leopard only, but 2.0 format). Unfortunately, there hasn't been enough time in the day to try various configurations - and I posit that IB should be that broken with any format it supports anyway.

All in all, IB 3.0 seems to have escaped a little too early. I guess Apple can be forgiven for this in the sense that it was surely better for it not to have to hold up the release of Leopard. It's also effectively a "version 1", being a complete rewrite of Interface Builder - the first rewrite of this venerable tool in many years, by all accounts. Still, as I see it, it's currently the weakest part of the development tool suite, and I really hope that we'll see a rev. of the development tools really soon, with the attendant bug fixes (at least), if not some improved functionality for reparenting views and inserting view between existing parent-child views relationships.

Possibly the next release of the dev tools will be when Apple release the iPhone tooling - and naturally I hope the dev tools group has had at least some cycles to improve the core tools, even if they've had to be involved in supporting a lot of iPhone development features too. Otherwise I'll have to be even more patient to see some of the bugs I've raised on these issues get fixed - and unfortunately I can see a lot of IB3 usage coming up in the next little while on my project :-(

No comments: