Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Storyboards vs Xib files

I read some answers related to the same question, but I'd like to ask for something specific. When you have a HUGE project, imagine a big social network, even if you separate your UIViewControllers logically into separate UIStoryBoards, it still seems like it slows down the process. Every time you view any story board, it takes a while to render all of the UIViewControllers and it seems like a huge pain to deal with.

Now, for large projects, would you go for Nib files or is it better to stick to UIStoryBoards?

like image 336
Dani Avatar asked Jun 24 '17 10:06

Dani


People also ask

What is difference between XIB and storyboard?

XIB and Storyboard are used for creating interfaces for users. One important point is,xibs are used for creating a single view(it has single file owner at the top of the xib file), but in-case for viewcontroller, multiple screens can be added and its flow can also be monitored(it has separate file owners).

What is an XIB file?

What are XIB files? From the point of view of the UI designer, XIB files contain the views or windows that you design in Interface Builder – the controls, their layout and properties, and their connections to your code. It is important to understand that on a technical level, XIB files are stored object graphs.

Are storyboards still used Swift?

SwiftUI is not replacing storyboards ; it may replace xib in some cases. But IMHO, SwiftUI is still far from providing the capabilities of xib. Just read in SwiftUI forum to see how developers are struggling to replicate what is easily done with xib and storyboards and autoLayout.


2 Answers

If it is a large project with many view controllers and there is a team collaborating on it, I would recommend XIB. This is because each small team will not have to understand the entire flow of the project so no need a storyboard with these relationships. And another big advantage is that when they merge there codes together, it will be less likely to have a merge issue. You don't want to have a merge conflict for a storyboard, trust me.

If only yourself are working on this, having a storyboard will indeed show the entire project flow and make you understand things more. So my recommendation in this situation is that keep using storyboard unless the storyboard loads in an unreasonable amount of time.

like image 155
Fangming Avatar answered Oct 02 '22 16:10

Fangming


It is not to tell which one is the better. because which one is good to tell based on team requirement.

If you are a single developer, it is better to use storyboard because it consumes less time to load all views. but when If the team consists of many developers, use XIB, otherwise, it is not easy to merge the modules/tasks.

You can more read abouts pros and cons of using of both things here. http://codewithchris.com/xcode-using-storyboards-and-xibs-versus-creating-views-programmatically/

like image 40
Jaydeep Vora Avatar answered Oct 02 '22 17:10

Jaydeep Vora