Creating a fluidic user-interface is one of the biggest challenges faced by mobile app developers irrespective of the operating system which they work on and iOS is no exception to it.
Considering iOS, developers have three options to juggle between which are NIBs, Storyboards and coding. Each of these three user interface building blocks has supporters and haters in equal numbers.
While the coding option is for those who love to do things in the hardcore way, Storyboards and NIBs are preferred by those who welcome simplifications and automations. However the discussion on which method is the best depends on the various factors like size and type of the project and the programmer who is working on it.
So, to skim off the doubts and make a few things clear on the highlights and drawbacks of these UI building methods, we decided to hear it from R.Vijayakumar an experienced iOS app developer at Contus. Here are the highlights of the questions raised to him.
What according to you are Storyboards and NIBs in short?
Storyboard is an improvement on the NIBs concept and is the latest addition to the iOS UI toolkit. Storyboards helps you visually see the flow of your application, how the contents are represented in each layout (screens) and the transitions between them. It also helps you to manage the way controllers like View Controllers, Nav Controllers, TabBar Controllers etc communicate and respond to each other.
NIB files are those which represent a single view element and can be placed in the interface builder to get a visual of what it will look like. This helps you to create the user interface graphically.
What is “coding”? Why is it main feature of development apart from Storyboard and Nib?
Coding is the old school way of creating user interface in which all the graphical representations, positioning of elements etc are done by handwritten code. Though coding is considered time taking and studious by few of the new-generation developers this method has its own share of advantages.
First of all, coding provides you a free hand and a great control over the UI you are working on by reducing the dependency on some pre-defined tools which often hides the hardcore coding involved in it.
Developing UI programmatically will improve the performance of an app and while debugging, a developer can look for errors in the codes instead of checking it out with the interface builder. Merging codes can be done with much of ease and in a better pace.
How efficient or advantageous is using NIBs in UI development?
NIBs concept is the first ever methodology rolled out by Apple to visually design user interface in iOS. Well, with the Storyboards emerging as evolutionary improvement on NIB files, the latter is still preferred by a lot more due to the following reasons.
NIB files can be used to design any view and can be easily merged into the view controller wherever needed. NIB files represent the visual objects of your application and are packed along with controllers like View Controllers, Nav Controllers, TabBar Controllers etc. A view can be broke down into separate modules with NIB files of their own or even multiple modules (related) can be grouped in to a same NIB file.
- User-interface components which are repeatedly used in various parts of design can be stored as a separate NIB file and can be re-used whenever needed.
- It becomes much easier to develop, test and debug individual components
- Easy to spot misalignment’s and make minute adjustments
- Has less merging conflicts compared to Storyboards
- Each individual component can be independently developed and can be placed on the Interface builder to make it to a visual tool.
- However, using NIBs files UI can be shaped up
- Shaping up a UI using NIBs files single-handedly
- The UI can be shaped up using NIBs files single-handedly, but in a team environment, when two or more developers work on a project, it will be hard to spot the connections between classes. In case of storyboards, complete flowchart of the UI is readily available and hence these miscommunications don’t arise.
Can NIB and Storyboard be added into a single project?
The Xcode development tool allows the integration of NIBs and Storyboard and even coding into one single project, thanks to Apple Inc.,. NIB files can be used to overcome certain limitations of storyboards. For instance, in storyboards, adding UIView outside the View Controller is not possible and this limitation can be overruled by using NIB files.
Storyboards handle the flow between the controllers and for the flow of data to be fluidic a developer will have to switch on to the programming mode.
Preview shots of the Storyboards View Controller.
How and from which part a beginner should start with?
A beginner should have basic knowledge of OOPS concepts and C baseline. Understanding these basic concepts is the baseline to develop user interface for apps on iOS platforms as it is on the OOPS concepts the whole flow works on.
Well, considering all these suggestions, it is still very confusing to pick out the clear winner. It is better to conclude that the usage of these tools is purely based on the context, which means the type, size and demands of the UI design. And with the freedom to make use of all three methods in one single project, it’s is a waste of resource to stick to just one concept and ditch the others.
You would also be interested to learn: How to get crash reports without Xcode and Analyze