Fattaneh Talebi
Fattaneh Talebi

Reputation: 767

Is it a good idea to use xib files in storyboard

I have a project which is based on storyboard. The problem is some views are repeated in some view controllers.
I created xib file for these repeated views and then I use don't create theses view again. I just add a uiview and set its class to the custom view I have created.
It work ok as it avoids repeated view changes.

But I don't know if this cause performance or any other problems later. And I cannot change the whole project to only use with xib files.

Upvotes: 0

Views: 100

Answers (2)

Pankaj K.
Pankaj K.

Reputation: 535

If your project has similar kind of design or view then yes using xib with storyboard is good. you can reduce redundancy by taking similar kind of view or Tableview cell or collectionview cell. that will also make your storyboard neat and clean.

you can check this and based on that you can use as per your requirement. Which is more efficient way? StoryBoard or XIB?

Upvotes: 1

Amirhossein Validabadi
Amirhossein Validabadi

Reputation: 303

one of the clean code goals is to reuse your code. so base on this, xib file is a good solution, but about performance, using interface builder has less performance than implementation through code. if you are concern too much about performance, use the code, if not, your implementation is ok.

Upvotes: 1

Related Questions