Questions tagged [xib]
XIB is the file format for Interface Builder, which is a development tool for the Mac OS X & iOS platforms.
3,014
questions
819
votes
33
answers
296k
views
Loaded nib but the 'view' outlet was not set
I added a new nib file to my project, and tried to load it.
However, when I click on the toolbar icon that is supposed to take me to the view that I created, I get an NSInternalInconsistencyException ...
301
votes
23
answers
221k
views
How do you load custom UITableViewCells from Xib files?
The question is simple: How do you load custom UITableViewCell from Xib files? Doing so allows you to use Interface Builder to design your cells. The answer apparently is not simple due to memory ...
266
votes
16
answers
387k
views
How to Empty Caches and Clean All Targets Xcode 4 and later
Jonathan suggest here: Xcode Includes .xib files that have been deleted! that cleaning all targets and empty the caches will fix the problem with Xcode including deleted .xib files but I cannot find a ...
192
votes
8
answers
153k
views
How can I load storyboard programmatically from class?
My problem is that I was looking for way to use both storyboard and xib. But I can't find proper way to load and show storyboard programmatically. Project was started developing with xib, and now it's ...
185
votes
30
answers
259k
views
Load a UIView from nib in Swift
Here is my Objective-C code which I'm using to load a nib for my customised UIView:
-(id)init{
NSArray *subviewArray = [[NSBundle mainBundle] loadNibNamed:@"myXib" owner:self options:nil];
...
168
votes
6
answers
100k
views
What is the difference between a .xib file and a .storyboard?
Can someone explain in simple words the difference between .xib and .storyboard?
159
votes
11
answers
143k
views
Load view from an external xib file in storyboard
I want to use a view throughout multiple viewcontrollers in a storyboard. Thus, I thought about designing the view in an external xib so changes are reflected in every viewcontroller. But how can one ...
158
votes
9
answers
65k
views
Could not insert new outlet connection [duplicate]
Could not insert new outlet connection: Could not find any information for the class and not showing any class named "ViewController"
Solutions I have done :
- Restarted XCode
- Restarted System
- ...
139
votes
6
answers
26k
views
Xcode changes unmodified storyboard and XIB files
Storyboards are rather a royal pain from a git workflow perspective when multiple people are collaborating on them. For example, the XML in the .storyboard file has its starting <document> tag's ...
114
votes
7
answers
166k
views
How to load a xib file in a UIView
I have been searching everywhere and nothing so far has worked for me.
Basically I want to have a .xib file called rootView.xib and inside it I want to have a UIView (lets call it containerView) ...
101
votes
6
answers
105k
views
Correct way to load a Nib for a UIView subclass
I am aware this question has been asked before but the answers are contradicting and I am confused, so please don't flame me.
I want to have a reusable UIView subclass throughout my app. I want to ...
96
votes
3
answers
71k
views
Custom views with Storyboard
In complex screens (View Controllers) I used to separate the whole thing in smaller pieces (I call them widgets). These widgets consist basically of a MyWidget.h and a MyWidget.m file as well as a ...
83
votes
7
answers
37k
views
Reuse a uiview xib in storyboard
I typically like to create and design my uiviews in interface builder. Sometimes I need to create a single view in a xib that can be reused in multiple view controllers in a storyboard.
79
votes
28
answers
50k
views
IOS project showing error "An internal error occurred. Editing functionality may be limited" on xcode 7.1
I just created one new cordova ios project via CLI, and i opened that project in Xcode 7.1 and while running on simulator am getting some error on mainViewController.xib, if we clicked on that error ...
78
votes
17
answers
51k
views
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 ...
78
votes
2
answers
46k
views
How to set Hex color code in xib in iOS
I am not finding an option for Hex color code in xib color picker in xcode.
But I have seen in stack over flow answer,
https://stackoverflow.com/a/27283783/4391112.
In this, image is having Hex ...
74
votes
12
answers
38k
views
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 ...
68
votes
14
answers
107k
views
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: "...
62
votes
3
answers
78k
views
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 <UIKit/UIKit.h>
@interface MyCustomView : UIView {
IBOutlet ...
61
votes
9
answers
70k
views
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 ...
60
votes
3
answers
6k
views
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 ...
58
votes
2
answers
11k
views
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?
56
votes
2
answers
32k
views
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 ...
56
votes
11
answers
18k
views
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 ...
55
votes
2
answers
39k
views
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 ...
51
votes
4
answers
85k
views
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 ...
49
votes
4
answers
81k
views
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 ...
48
votes
7
answers
19k
views
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.
...
48
votes
2
answers
64k
views
Create UICollectionViewCell subclass with xib [duplicate]
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:
...
45
votes
8
answers
12k
views
Xcode 4.5 corrupting XIBs?
i am using the new xcode 4.5,
i have this lines of code on some view controller:
DiscoverCell* cell=[table dequeueReusableCellWithIdentifier:@"DiscoverCell"];
if(cell==nil){
NSArray *nib = [[...
45
votes
5
answers
51k
views
How to add new xib files
I have to develop an app with multiple screens. I have automatically generated xib file, but for my other screen I need another xib file. How do I create another xib file?
45
votes
4
answers
5k
views
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-...
41
votes
8
answers
48k
views
Alternative iOS layouts for portrait and landscape using just one .xib file
Using interface builder in xcode and just one .xib file, how can I create alternate layouts when rotating between landscape and portrait orientations?
See diagram of differing layouts
N.b. the green ...
41
votes
3
answers
13k
views
How to duplicate a .xib file?
I see there's no "duplicate" when I right click on a .xib. So is the way to do it: just to go to finder, copy the file to another name, and then drag it to my resources? Would that be all I'd need to ...
38
votes
5
answers
35k
views
Which is more efficient way? StoryBoard or XIB?
My question is slightly different then my title suggest.
I have worked with xib. Now i am trying to work with storyboard.
My question is if we are navigate through one class from another class, is ...
38
votes
2
answers
4k
views
How to disable Interface Builder document versioning from auto updating?
This question is still getting a lot of upvotes. So look at Update3. once you have upvoted, commented, answered, please please please file a radar
Viewing a nib / xib, modifies the file, forcing me ...
37
votes
5
answers
21k
views
UIViewControllerHierarchyInconsistency when trying to present a modal view controller
Trying to present a modal view controller with the following code
MapViewController *mapView = [[MapViewController alloc] initWithNibName:@"MapViewController" bundle:nil];
mapView....
35
votes
8
answers
16k
views
XIB File opens like an XML in XCode but opens correctly with Interface Builder
When I double-click my file StartWindow.xib in Xcode 4, it does not open into the integrated Interface Builder; it opens like a XML file. I can open all other xib files and they display as expected. I ...
35
votes
5
answers
33k
views
Easiest way to support multiple orientations? How do I load a custom NIB when the application is in Landscape?
I have an application in which I would like to support multiple orientations. I have two .xib files that I want to use, myViewController.xib and myViewControllerLandscape.xib. myViewController.xib ...
35
votes
4
answers
40k
views
How to open a new window on button click in Cocoa Mac Application?
I want to know how to open a new window on button click in Cocoa Mac Programming. Help me. I am doing a mac application which needs to open a new mac window on particular button click.
34
votes
8
answers
22k
views
Couldn't open xib file after git pull, invalid element name
I am working on project with another developer. We are working on bitbucket.
The problem is he made a changes in XIB files. After that when I do a git pull, I receive the changes but get an error on ...
34
votes
4
answers
21k
views
Execute code in Launch Screen
Xcode allows to create launch screen in .xib files via Interface Builder. Is it possible to execute some code with the xib, just like in usual view controllers? It would be great if we can set ...
33
votes
1
answer
16k
views
How To: Self-Sizing Custom-View from XIB with StackView View in iOS
I've recently started diving into iOS development with Swift again and am now looking into a custom UIControl. For layout and flexibility this custom view is built using a StackView.
What I want to ...
31
votes
6
answers
18k
views
Can you reference Xib files from static libraries on the iPhone?
In my app, i currently have all my code separated into a static library, to make it easier to set up the xcode project targets for the actual app and for unit tests for my code. The problem with this ...
29
votes
14
answers
77k
views
Loading a XIB file to a UIView Swift
I am trying to load my XIB file into a UIView but I am having some trouble. I have the required override functions but they seem to be crashing. Saying this error, warning:
could not load any ...
29
votes
4
answers
36k
views
How to link a .xib file to a class file with Xcode 4
have started a universal project under the new Xcode4. My Application works on both iPhone & iPad devices but not well design for the iPad. I have 2 .xib file for the MainWindow: MainWindow.xib (...
28
votes
3
answers
16k
views
Unsupported Configuration: This file is set to build for a version older than the deployment target. Functionality may be limited
Can anyone explain this warning?
Unsupported Configuration: This file is set to build for a version older than the deployment target. Functionality may be limited.
When my app was initially ...
28
votes
1
answer
15k
views
Using XCode storyboard to instantiate view controller that uses XIB for its design
I have a UIViewController subclass that I created previously that had its controls laid out in a XIB file.
I'd like to use this view controller in a storyboard now, but it seems although I can ...
27
votes
7
answers
8k
views
Can't add constraints in xib
I have a xib but I can't add constraints. When I control click and drag I can't do anything also the buttons at the bottom I can't do anything with it.
I'm using xCode 11.
27
votes
2
answers
45k
views
Autolayout aspect ratio for UIImageView / UIView
How to set autolayout for UIImageView /UIView so that the image view width and height increases a bit for iphone 6 and 6 plus. I have tried adding the constraint Aspect ratio but the increased height ...