XIB vs Storyboard, Which Shall I Choose in iOS Project

On March 3, 2016, in iPhone iPad Object-C, by James Liu

xib is the common way to build UI in Xcode. After Xcode 5.5, Apple introduced a new concept, storyboard. The purpose is to provide a better way to make UI simple and easy to manage. If you like, you can still use xib as your default UI editor.

When you are using xib, each UIViewController will bind with a xib. But in Storyboard, all your app screens are put together. You can use graphic interface to connect them with segues. Each way has its own pros and cons.

XIB vs Storyboard

Storyboard is a better way to manage all your app screen. But here are several reasons why I still choose xib as my default option.

  • Not suitable for teamwork: Storyboard is a single file which holds all app screen. For big project, it requires several programmers working on the same storyboard file concurrently. It will cause conflict on storyboard. And to solve the conflict in storyboard will be another headache problem. But xib doesn’t have this problem as each screen bind to one xib file.
  • Get slow when there are several screens: When working in the storyboard, it will get slow when the project has over 10 screens.
  • Easy to make whole app crush: Because all app screens are in one file, when there is a mistake in the storyboard, it could make the whole app crash.

Another Way to Build UI in iOS

In iOS, there is another way to build iOS UI. You can programme the UI manually in coding. Some people like this way as it could be simple to debug. From my point of view, this way requires you high programming technical level. So it is not suitable for common people.

 

Leave a Reply

WordPress Themes

WordPress Themes