views:

130

answers:

2

I am deciding on where using .xib files are needed while developing with MonoTouch.

My current project needs to work with iPhone and iPad, so I'm wondering if even using Interface Builder is worth it. I already have to remove some designer files so that 2 different views (one for each device) go to the same controller. I also am the only one working on this, and there will be no designer working in IB.

Here are a couple questions:

  • Is there any performance benefit/decrease to using XIBs?
  • Is there any software design issues, detracting from MVC, etc. that one way or the other will inihibit?
  • Is there any versatility drawbacks to using XIBs, like is it tough to implement lazy-loading for certain views with XIBs?

Thoughts?

+3  A: 

I just recently had to make the same decision, and I decided to go xib-less. I found it easier to be able to see exactly what was happening when.

With the iPhone and iPad interfaces being relatively simple, I wasn't getting a huge benefit from IB, but there was a lot of jumping around between MonoDevelop and IB. Like you, I wasn't working directly with designers.

I do the initial layout in IB to get the coordinates. After that, I just do modifications directly in the code.

There's also the benefit of having less files.

Another advantage was in asking questions. It's much easier to email colleagues chunks of code, than code and xib files. I can also easily extra the core code need to specify the question succinctly.

As to your questions... I found it easier to think about and structure my project according to MVC when I was in complete control - but maybe that's just me. For my project, I didn't really find something where I thought a xib file would have been much better. As for performance, I've not done any tests, so can't really offer an informed opinion on that. I read a post somewhere that the difference was negligible, but a quick search hasn't dug it up. I'll try and locate it tonight.

dommer
Do you know of an example project somewhere I can view someone doing everything without XIB? One following MVC? I have found XIB-less examples, but they usually are WinForms-looking and poorly designed with a monolithic class filled with event handlers.
Jonathan.Peppers
look at the tweetsharp project - it's using MonoTouch.Dialog
cvista
Only issue with this is that we're about to undergo a complete ui overhaul and doing this when all of the components are 100% c#. I'd still prefer this to XIB - they tend to make your code a complete mess. Real cutting edge, apple.
cvista
+2  A: 

We went xib less and the views where there are no xibs seem to be more performant. I find Apples interpretation of MVC confusing.

cvista
I don't even feel like Apple's interpretation of MVC is even MVC. There is way too much UI code in your "controller" implementation for any standard app. But that may be b/c I usually work with WPF and MVVM--which is far above from a sofware-design standpoint.
Jonathan.Peppers