IBDesignable is a designation given to views in Xcode 6 that allows them to be rendered directly in Interface Builder without the need to build and run the application.
Questions tagged [ibdesignable]
279 questions
15
votes
6 answers
@IBDesignable not working in iOS swift 3
What I did:
Deleted derived data, Restarted xcode, Editor->Refresh all views
I am getting Designables build failed in storyboard when I click on Editor->Refresh all views.
Please check the following code. What am I missing? Textfiled is not…

abhimuralidharan
- 5,752
- 5
- 46
- 70
15
votes
1 answer
Configuring @IBInspectable Attribute Inspector controls
Is it possible to configure how @IBInspectable properties are displayed and/or controlled in the Attribute Inspector? For example, I have a CGFloat property "Overlay Alpha" which shows up in the inspector like this:
The problem is that the…

Anna Dickinson
- 3,307
- 24
- 43
13
votes
1 answer
Controlling the targets Interface Builder builds for IB_DESIGNABLE / IBDesignable
I'm trying to make use of IB_DESIGNABLE in my app.
The problem is my app is huge and takes an appreciable amount of time to build (ie. many minutes), so I would like keep all my custom views in a separate target and have Interface Builder only build…

JosephH
- 37,173
- 19
- 130
- 154
13
votes
1 answer
Make a fixed size UIView, like UISwitch (using IBDesignable)
When I'm using this guide to create a view that is designed in a XIB, reusable from within a storyboard using the IBDesignable attribute on my UIView subclass, how do I make it have a fixed size, and have its resizing behavior match that of a view…

pancake
- 1,923
- 2
- 21
- 42
13
votes
2 answers
Does Interface Builder's new IBDesignable attribute work with NSButton and other controls in Cocoa?
I have managed to get the IBDesignable/IBInspectable attributes working with direct subclasses of NSView but not with a direct subclass of NSButton. This is causing me to question if in fact the Cocoa implementation is somehow limited to NSView…

Sam
- 2,745
- 3
- 20
- 42
12
votes
2 answers
Xcode 9: Using named colors with IBDesignable and IBInspectable results in Interface Builder error, but compiles without issue
I use UIColor.named("myColor") throughout my app since Xcode 9 came out. While having a shot at a custom implementation of UITextField as an IBDesignable class, I kept getting the following error:
error: IB Designables: Failed to render and update…

Fulco
- 284
- 1
- 3
- 16
12
votes
4 answers
Round Corners UIView in Swift 4
In swift 3 I could do something like this to make my UIView corners round:
import UIKit
@IBDesignable
class DesignableView: UIView {
}
extension UIView {
@IBInspectable
var cornerRadius: CGFloat {
get {
return…

Jonathan Solorzano
- 6,812
- 20
- 70
- 131
12
votes
3 answers
@IBDesignable view doesn't draw background color inside Interface Builder
I'm curious why doesn't this set the backgroundColor to red?
@IBDesignable class CustomLabel: UIView {
let view = UIView()
func setup() {
backgroundColor = UIColor.red
view.backgroundColor = UIColor.green
view.frame = CGRect(x: 0,…

Morgan Wilde
- 16,795
- 10
- 53
- 99
12
votes
1 answer
Previously rendered IBDesignable hangs on "Updating" in storyboard
Xcode 7.0.1 (7A1001)
iOS 9.0
I made a custom @IBDesignable UIView, only implementing the drawRect function. Like so:
@IBDesignable
class CustomView: UIView {
override func drawRect(rect: CGRect) {
let context =…

forgo
- 932
- 1
- 7
- 20
12
votes
3 answers
IBDesignable never finishes updating UITableViewCell in storyboard
This is a similar question to this but not quite the same.
I have created a subclass of UITableViewCell which references a custom nib and marked it as @IBDesignable. Changes that are made both in code and from the .xib file display correctly in the…

Hamer
- 1,354
- 1
- 21
- 34
12
votes
2 answers
IBDesignable UIViewController
I'd like to be able to layout my view controller in code but see the layout displayed in interface builder.
I know I can create a UIView subclass, make that IBDesignable, and assign it to the view controller's view, but this would require that I…

Jeff Ames
- 1,555
- 11
- 27
10
votes
3 answers
IBDesignables, no suitable image found, required code signature missing
I recently made some changes to Assets.xcassets and this caused absolute chaos for XCode. I ended up with multiple errors of this kind: Failed to render and update auto layout status for *MyViewController* (6jf-cd-DYU) dlopen (AFramework.framework,…

nickdnk
- 4,010
- 4
- 24
- 43
10
votes
5 answers
@IBDesignable - @IBInspectable, class not key value coding-compliant
I'm suddenly having a strange and reproducible error when using an @IBDesignable class, @IBInspectable properties are giving the following warning:
Main.storyboard: warning: IB Designables: Ignoring user defined runtime attribute for key path…

Craig Grummitt
- 2,945
- 1
- 22
- 34
10
votes
1 answer
Making NSArray IBInspectable
Is there a way to use NSArray IBInspectable in order to define multiple values in Storyboard custom view?
I know that NSArray doesn't have any information about the type of object that will be stored in it so it probably is a problem. But there is…

Wallace
- 504
- 4
- 19
10
votes
3 answers
Using IBDesignable and prepareForInterfaceBuilder with a UILabel
I have a subclass of UIView called MyView that I am creating.
In it there is a UILabel (this is added in code not in InterfaceBuilder for reasons).
I then have a property on MyView called color.
What I'd like is to have Interface Builder be able to…

Fogmeister
- 76,236
- 42
- 207
- 306