Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Interface Builder (XIB) or Code when merging in a team environment?

Merging interface builder files with others (and even myself from a different computer) can be a real challenge. The XIB xml is certainly better than NIBs but even as xml, I've found cases where merging and getting a consistent and valid XIB was harder than just taking the other and manually redoing the changes made.

I'm wondering what other folks are doing who have multiple folks who can potentially collide on XIBs.

Was merging a consideration for going all code? Do you use XIBs just for layout and code the rest? Or, have you had any luck merging XIBs and over time you just get better at manually reading?

EDIT: My current approach is using it for strict layout (what it's really good at and painful to code) and setting all the options and data via code. I find code much easier to merge but laying out controls in code is tedious. Thoughts?

like image 453
bryanmac Avatar asked Sep 17 '11 18:09

bryanmac


1 Answers

Was merging a consideration for going all code?

Yes, No, and "Portions Of". It depends on things like:

  • The people involved
  • the complexity of the UI
  • the quality of the implementation you need.
  • the expected lifetime of the implementation

But yes, it has been, and it often is when the case is just not trivial -- Otherwise, you just fight it by decomposing XIBs into smaller pieces. That can work pretty well (or not), depending on what you are faced with.

Do you use XIBs just for layout and code the rest?

Depends on a lot of things.

  • XIB-only has its restrictions, and is much like code duplication. I use it at times for prototyping, other times because that's what somebody else favored.
  • "A little of both" can require a lot of glue. At times, it can be pretty disorganized -- e.g. "where's that action really set?". Of course, this can also be used to achieve what some would consider a good balance of XIB and programmatic separation. The simpler the XIB is, the less often it will need to be adjusted, and less likely it will cause merge conflicts.
  • Code-only is my preference, but there are people who just prefer WYSIWYG, and people aren't very familiar writing UIs programmatically. As well, if quality, reusability, and maintainability not requirements (e.g. bang out a prototype), then code-only can be overkill.

Or, have you had any luck merging XIBs and over time you just get better at manually reading?

No real luck -- just by breaking them into smaller components. Unfortunately, the "Decompose Interface" option (from IB3) is not available in Xc4's editor.

like image 87
justin Avatar answered Oct 19 '22 22:10

justin