Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dynamic Storyboard or Xibs/Nibs

Our company is developing a quite large app for the iPad. Eventually we want to be able to customize the UI per customer (tenant) and maybe even per user (of that customer). We started off in HTML5 but are moving to native.

I've done some reading on downloading XML from the server (or even generated XIB/NIB files) and dynamically adding those to your app.

Now with iOS 5 (and even further in 6) storyboarding is playing a big role.

My questions:
- Would it be better to use (multiple?) storyboards or XIBs?
- What are my options for both if I want to deliver a dynamic user interface?

I'm not looking for a magic pill, nor a discussion on HTML5 vs native, just some information on how I could deliver a dynamic interface and what techniques could help in doing so.

like image 966
Zyphrax Avatar asked Jul 28 '12 11:07

Zyphrax


2 Answers

my response to your two questions is:

  1. storyboard is great for scene management; it creates a visual connection between your various scenes/views. i prefer to use storyboard for as much of my UI as possible. however, there are elements that i have in some apps that pick up existing or reusable or otherwise dynamic XIBs. i simply tie these together with my storyboards by loading the XIBs in code at the location at which i want them. so, my ultimate answer for your first question is "both", where storyboards are used where possible, and XIBs used for dynamic scenes/views.

  2. your options for dynamic user interface include at least the following two options (of which, as stated above, i prefer the second):

    1. create all code using XIB files, and perform all UI transitions without storyboards in code
    2. create as much UI as you know will remain relatively static in terms of relationships between viewControllers with storyboard, and then load the dynamic parts of the UI using initWithNibName:bundle:

finally, you can use multiple storyboards if the situation warrants, and this could even apply to dynamic UI, whether it comes from re-usable components created elsewhere in storyboard and maintained separately, or storyboard XML (if you look at storyboard source, it is just XML under the hood) whether acquired from something that generated or wherever. you can even decide to manage your UI with multiple storyboards at the design phase if your app will have several complicated interconnected view-controller scenes (e.g. each tab in a UITabBarController may have its own storyboard, where each storyboard's scene rootController is connected/loaded when a tab is chosen).

like image 84
john.k.doe Avatar answered Sep 20 '22 13:09

john.k.doe


StoryBoard all the way! I use to absolutely dislike storyboards, but then i got use to them and now i love them. Storyboards are the way to go.

like image 40
user1555256 Avatar answered Sep 20 '22 13:09

user1555256