Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When Should I Use The Interface Builder?

As I'm learning the iPhone API, the book I'm using has me doing everything possible with the Interface Builder. We (lonely here sometimes) are writing code, too, but I really feel like I'm getting to know the Interface Builder quite well.

I know that the Interface Builder is different from other GUI Builders as it uses serialized objects and doesn't write code. This is supposedly a good thing. So...in day-to-day work, is it the tool of choice, or should I try to get over my dependence on the Interface Builder?

Also: if you suggest that "it depends on what you're doing," what does it depend on? How should I make the decision to use the Interface Builder or not?

Note: The subjective and argumentative version of this question was titled, Interface Builder: Serious Tool or Just For Kids? but I decided against it since I want to avoid getting the question closed.

like image 643
Dan Rosenstark Avatar asked Mar 02 '10 21:03

Dan Rosenstark


People also ask

Should I use Xib or storyboard?

BUT, if you a professional developer, you MUST use xibs for VCs, Cells, etc, Because this is the only way to make them really reusable and portable, in order to gain so much time for the next project, or even when having to make a little change or build the storyboard again.

What is Interface Builder in iOS?

Interface Builder is a software development application for Apple's macOS operating system. It is part of Xcode (formerly Project Builder), the Apple Developer developer's toolset. Interface Builder allows Cocoa and Carbon developers to create interfaces for applications using a graphical user interface.

Should I use storyboards or SwiftUI?

For most new developers coding on iOS 13 or higher, you should learn SwiftUI. If you need to maintain an older code base with Storyboards, you should learn Storyboards.

Where is Interface Builder in Xcode?

Creating the interface First, in Xcode, go to the Resources folder from the tree view on the left and select MainMenu. xib . It will open in the main view. This is where you are going to build you UI.


2 Answers

Interface Builder really is used to make apps. Take a look at any Cocoa-based Mac app — which is most that aren't by Adobe or Microsoft — and you'll see it's full of nibs. It's slightly more common for iPhone apps to be made without Interface Builder (because the original SDK shipped without IB), but it's still a very commonly used tool.

The difference between Interface Builder and most other GUI builders is that Cocoa and Interface Builder were designed with each other in mind. In fact, if you search the Cocoa mailing list archives, you'll find lots of people over the years wondering how it's possible to make a Cocoa app without using Interface Builder. (The answer is always the same: You can do it all in code, but you'd just be wasting your time and making it harder to design a good interface.)

like image 63
Chuck Avatar answered Oct 01 '22 19:10

Chuck


Yes there is small difference. The difference is that IB use little more storage and RAM memory that programmatically generated interface. Here is my simple example. { I am new in OBJ-C }

enter image description here

The source code and binary app here http://www.mediafire.com/download/9ph1zs1kyag9f1g/TestDifference_IB-Programmatically.zip

like image 32
Daniel Valeriev Avatar answered Oct 01 '22 18:10

Daniel Valeriev