0

I usually used to do every thing programmatically, what I mean is I am not using the Interface builder instead I do every thing in the code, like UIButton or UITableView, etc.. So can anyone tell me what is the best for programming iOS, or does that make any difference on the application performance or any thing else?

I am new to programming so I wanna hear that from someone in the field, I searched in Google but I couldn't find a clear answer.

Thanks.

rmaddy
  • 314,917
  • 42
  • 532
  • 579
M.Alatrash
  • 1,270
  • 1
  • 12
  • 30

2 Answers2

1

The advantage of using IB is that it allows you make interface really quickly without checking a hundred times that a label should be moved up or down by pixel or two. But when you use IB you can't inherit nib files so if you have a lot of common interface features in several view controllers across your app you probably should use just code.

Andrey Chernukha
  • 21,488
  • 17
  • 97
  • 161
  • and what if I want to develop an application to fit both the iPhone and the iPad in the same time, should I create a separate Xib file?? – M.Alatrash Jun 05 '13 at 07:10
  • @MKAlatrash check this http://stackoverflow.com/questions/5191472/ios-using-device-modifiers-for-loading-xib-files/5198133#5198133 – Andrey Chernukha Jun 05 '13 at 07:13
1

You really should separate your views from the code. This is what for Interface Builder was made for.
It builds xml files, apart from your application logic, so when you'll need to change anything in design you won't have to touch your code, and mess anything by mistake.
All modern program designs separate view from business logic: MVC, MVVM, MVP and so on. It is considered the best pattern for programming.

pbibergal
  • 2,901
  • 1
  • 17
  • 19