Questions tagged [interface-builder]

Interface Builder is a visual design tool used to create user interfaces for Apple's macOS and iOS platforms.

is a visual design tool used to create user interfaces for Apple's and platforms. It is part of , Apple's . allows , and developers to visually compose interfaces for applications. The resultant interface is stored as a file (short for XML Interface Builder) and is compiled to a file at build time (short for NeXT ).

6236 questions
96
votes
3 answers

"Width equals height" constraint in Interface Builder

I can't find a way to create a 'square' constraint, meaning 'width equals height' in Interface Builder. I guess it's possible to add such constraint programmatically. Is there something I can do in IB? Maybe I just don't see it? It seems trivial,…
DemoniacDeath
  • 1,778
  • 3
  • 13
  • 25
95
votes
18 answers

how do I use UIScrollView in Interface Builder?

While I've used UIScrollView successfully in the past by manipulating it programmatically, I'm having trouble getting it to work by setting it up exclusively in Interface Builder. I have a simple "about" page in my iPhone app. It has a…
George Armhold
  • 30,824
  • 50
  • 153
  • 232
92
votes
9 answers

Xcode - Is there a way to drag a component from one view to another without losing its frame?

What I'd like to do is drag a component/view from one superview to another in Xcode's interface-builder without having its frame/position be reset. Xcode's default behavior when doing this appears to be to center the view being moved vertically…
aroth
  • 54,026
  • 20
  • 135
  • 176
91
votes
1 answer

What are File Owner and First Responder in iOS - Xcode?

What are File Owner and First Responder in iOS - Xcode?
Matrix
  • 7,477
  • 14
  • 66
  • 97
90
votes
16 answers

Loading a Reusable UITableViewCell from a Nib

I am able to design custom UITableViewCells and load them just fine using the technique described in the thread found at http://forums.macrumors.com/showthread.php?t=545061. However, using that method no longer allows you to init the cell with a…
Greg Martin
  • 5,074
  • 3
  • 34
  • 35
90
votes
6 answers

How to create an IBInspectable of type enum

enum is not an Interface Builder defined runtime attribute. The following does not show in Interface Builder's Attributes Inspector: enum StatusShape:Int { case Rectangle = 0 case Triangle = 1 case Circle = 2 } @IBInspectable var…
SwiftArchitect
  • 47,376
  • 28
  • 140
  • 179
90
votes
3 answers

iOS autolayout to center my view between two views

How to set up autolayout in Interface Builder to arrange views vertically as shown on image: Top view pinned to top screen edge, Bottom view pinned to bottom screen edge. My view should be centered between top and bottom views (so distance to Top…
brigadir
  • 6,874
  • 6
  • 46
  • 81
89
votes
10 answers

Can't resize UIView in IB

Probably something simple, but I can't figure why I cannot resize a UIView in a xib in Interface Builder. I created a new view XIB in xcode and in the size inspector, the width and height are disabled and grayed out to 320 by 460. This is strange…
Ayrad
86
votes
8 answers

UITextField "value changed" not firing when field is updated

I have an IBAction that I have connected to a UITextField element in Interface Builder. (Firing on "value changed" event) I also have a UISlider that updates the TextField element automatically when it's value gets adjusted. When I run my app, the…
Andrew Lauer Barinov
  • 5,694
  • 10
  • 59
  • 83
86
votes
6 answers

How to send objects in NIB files to front/back?

How can I adjust the "z"-positions of objects (e.g. sending UIImageViews to the front/back) in the integrated interface builder in Xcode?
Joe
  • 2,187
  • 3
  • 15
  • 11
86
votes
12 answers

Alignment UIImageView with Aspect Fit

for my UIImageView I choose Aspect Fit (InterfaceBuilder) but how can I change the vertical alignment?
Maurice Raguse
  • 4,437
  • 2
  • 29
  • 46
86
votes
8 answers

Could not instantiate class named IBNSLayoutConstraint

I'm using XCode6 beta and trying out Swift. When I put some auto layout constraints in a view controller the app crashes with the following error: Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: 'Could…
zbrox
  • 2,683
  • 3
  • 25
  • 29
84
votes
2 answers

Programmatically send to front/back elements created from interface builder

In interface builder, there are layout options to send to back or send to front any elements such as UIButton, UIImage, UILabel etc... Now, I would like to do the same at runtime, programmatically. Is there an easy way to do that? I do not want to…
Yohann T.
  • 1,915
  • 2
  • 23
  • 28
83
votes
7 answers

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.
Garfbargle
  • 3,222
  • 2
  • 17
  • 17
82
votes
2 answers

Remove Content and Frame layout guides from UIScrollview

I made a pod Xcode 11 and iOS 13, created an UIScrollview and set my content there. While installing on an older main project, this alert message shows: Content and frame layout guides before iOS 11.0 I can see the said layout guides in Interface…
alxlives
  • 5,084
  • 4
  • 28
  • 50