Questions tagged [xib]

XIB is the file format for Interface Builder, which is a development tool for the Mac OS X & iOS platforms.

is a software development application for Apple's Mac operating system. It is part of (formerly Project Builder), the Apple Developer Connection developer's toolset. Interface Builder allows and Carbon developers to create interfaces for applications using a graphical user interface. The resulting interface is stored as a .nib file, short for NeXT Interface Builder, or more recently, as a .xib () file.

Interface Builder is descended from the NeXTSTEP development software of the same name. A version of Interface Builder is also used in the development of OpenStep software, and a very similar tool called Gorm exists for GNUstep. On March 27, 2008, a specialized iPhone version of Interface Builder allowing interface construction for iPhone applications was released with the iPhone SDK Beta 2. As of Xcode 4, Interface Builder no longer exists as a separate application, and its functionality is directly integrated into Xcode.

The Interface Builder editor within Xcode makes it simple to design a full user interface without writing any code. Simply drag and drop windows, buttons, text fields, and other objects onto the design canvas to create a functioning Mac, iPhone, or iPad user interface.

Because Cocoa and Cocoa Touch are built using the Model-View-Controller pattern, it is easy to independently design your interfaces, separate from their implementations. User interfaces are actually archived Cocoa or Cocoa Touch objects (saved as .nib files), and OS X and iOS will dynamically create the connection between UI and code when the app is run.

Resources:

3016 questions
78
votes
17 answers

Converting iPhone xib to iPad xib?

How do you do it? I saw one video tutorial on it, but the screen was too small. Also, other than changing the view size, are there any other major changes I would have to make to my iphone apps to convert to iPad?
NextRev
  • 1,711
  • 4
  • 22
  • 31
74
votes
12 answers

What are the benefits of using Storyboards instead of xib files in iOS programming?

What are the main differences between using Storyboards and xib files. Specifically, what are the advantages or disadvantages of using a Storyboard? Unfortunately, despite doing quite a bit of research, all I've been able to find on Storyboards are…
Steve
  • 743
  • 1
  • 5
  • 5
67
votes
14 answers

Loading ViewController from xib file

I had a MyViewController.swift and a MyViewController.xib presenting the layout of MyViewController. I tried different methods to load this view controller including: //1 let myVC = UINib(nibName: "MyViewController", bundle: …
bluenowhere
  • 2,683
  • 5
  • 24
  • 37
62
votes
3 answers

Adding a custom subview (created in a xib) to a view controller's view - What am I doing wrong

I've created a view in a xib (with an activity indicator, a progress view and a label). Then I've created .h/.m files: #import @interface MyCustomView : UIView { IBOutlet UIActivityIndicatorView *actIndicator; IBOutlet…
Sefran2
  • 3,578
  • 13
  • 71
  • 106
61
votes
9 answers

Assign xib to the UIView in Swift

in objective c it can be done in init method by -(id)init{ self = [[[NSBundle mainBundle] loadNibNamed:@"ViewBtnWishList" owner:0 options:nil] objectAtIndex:0]; return self; } but when i do this in swift init(frame: CGRect) { self =…
Siu Chung Chan
  • 1,686
  • 1
  • 14
  • 31
60
votes
3 answers

How to avoid Xcode gratuitous edits to storyboard files?

When I navigate to one of my xib files, Xcode marks the file as touched. Undo and revert have no effect. Saving seems to do no harm, but the glitch causes me frequent additional git work. Has anyone else seen this or have an idea about something…
danh
  • 62,181
  • 10
  • 95
  • 136
58
votes
2 answers

What's the difference between custom class and file's owner setting in xib file?

In a custom xib file, what's the difference between the two following setting methods shown in the images below?
Alfy
  • 889
  • 1
  • 7
  • 17
56
votes
11 answers

Text search though all .xib files in Xcode?

This seems like such a basic task, but I'm stumped. How, in Xcode, do you execute a textual search though (the XML contents of) all the .xib files in a project? For example, all of our .xib files contain this string on the second line:…
Jon-Eric
  • 16,977
  • 9
  • 65
  • 97
56
votes
2 answers

Storyboards vs. the old XIB way

I am new to iOS and was wondering which is the best to learn. I have read some of the answers here and SO, but some people say use Storyboards will others say learn XIBs first. Is there any real benefit to learning XIBs? Are XIBs easier to…
cdub
  • 24,555
  • 57
  • 174
  • 303
55
votes
2 answers

How do I change "initwithNibName" in storyboard?

I want to change below code with storyboard with Xcode 4.2. UIViewController * example = [[ExampleViewController alloc] initWithNibName:@"ExampleViewController" bundle:nil]; Now ExampleViewController.xib file exist. but I want to make it with…
jokor7
  • 611
  • 1
  • 6
  • 8
51
votes
4 answers

Swift - How creating custom viewForHeaderInSection, Using a XIB file?

I can create simple custom viewForHeaderInSection in programmatically like below. But I want to do much more complex things maybe connection with a different class and reach their properties like a tableView cell. Simply, I want to see what I do.…
iamburak
  • 3,508
  • 4
  • 34
  • 65
49
votes
4 answers

How to load custom cell ( xib) in UICollectionView cell using swift

I have created a small sample project using Swift. I have created an "MyCustomView" as xib which contains label, button and imageView as shown in below code: import UIKit @IBDesignable class MyCustomView: UIView { @IBOutlet weak var lblName:…
sia
  • 1,872
  • 1
  • 23
  • 54
48
votes
7 answers

How to hide Blue line covering views in xib/Storyboard in Xcode

I am using xcode 7.2, in xib when i insert any view, label,txtField etc., all are showing this covering blue line. now it is very hard to insert/manage new view or anything in xib due to this line. Does anybody know how to hide these?
Deepak Chaudhary
  • 1,723
  • 1
  • 15
  • 29
48
votes
2 answers

Create UICollectionViewCell subclass with xib

I'm trying to create a UICollectionViewCell subclass with linked a xib, I have do this: I have create a new xib file and I have add a UICollectionViewCell in it, then I have create this subclass file: @interface MyCell :…
Piero
  • 9,173
  • 18
  • 90
  • 160
45
votes
4 answers

Why is my XIB modified every time I open it in IB?

I click on the XIB via the project navigator. It opens up and immediately changes the icon to gray showing I have unsaved changes. If I save changes, click on a different file and click back to re-open it, more changes. Always modifies on open. It…
DBD
  • 23,075
  • 12
  • 60
  • 84