What are the benefits of adding views programmatically and using InterfaceBuilder?

I have heard that this is just a matter of preference. But there must be advantages to adding views programmatically. Any seasoned Xcoders don't want to comment?

+2


a source to share


3 answers


It will be much easier to do this with code when you add many similar interface elements.



Side benefit - I can understand what's really going on. Charles Petzold once said that he wouldn't write a C # book if he couldn't do everything through code. I think some programmers just don't like the feeling of automatic

generated code. This is not to say that IB is not suitable for programmers, it just is not good for understanding nuts and bolts. This is also one of the reasons many programmers love Delphi (and IDEs).

+1


a source


There is no advantage to doing anything in code that you can do in IB. It's just a bad habit that people bring with them from other platforms.



+1


a source


It is important to note that for very specific things it can be very useful to "program the view" if you need certain behavior, etc.

So, I wouldn't give up on this idea, but I recommend going with the Interface Builder for most of the stuff you're going to develop, it saves you a lot of lines of code + time.

0


a source







All Articles