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
3
votes
1 answer
iOS. Interface Builder @IBInspectable crashes
I'm trying this IBDesignable. But as always it don't work.
My controller code:
@IBDesignable
class MainMenuViewController: UIViewController {
@IBOutlet weak var languagesButton: UIView!
@IBOutlet weak var keyboardSettingsButton: UIView!
…

Vasyl Khmil
- 2,548
- 1
- 20
- 36
3
votes
2 answers
IBDesignable - IBOutlet is nil in property didSet method
Even though my property is viewable in IB’s property inspector when I select the appropriate view, the property’s didSet method does not update the relevant subview’s.
Here is my property:
@IBInspectable var imageRepresentation: UIImage = UIImage()…

Adam Carter
- 4,741
- 5
- 42
- 103
2
votes
1 answer
IBDesignable rendered at the top left of the screen instead of their correct position
I have a custom implementation of a checkbox / radio button in Swift.
The class is annotated as @IBDesignable. I implement layoutSubviews and prepareForInterfaceBuilder.
This implementation is distributed in a pod that is used in several…

Carl Sarkis
- 119
- 6
2
votes
1 answer
How to find out which constraint is not working or creating problem
I have created custom view for UITableView cell. When The app runs and the UITableView gets populated I gets too much design related warning.Let me quickly share the log for design i am getting
[LayoutConstraints] Unable to simultaneously…

A.s.ALI
- 1,992
- 3
- 22
- 54
2
votes
1 answer
Is there a way to make a custom constraint work in interface builder?
Make a UIView with a fixed height constraint, notice I set it to say 40 in IB.
Change the constraint class to this:
@IBDesignable class BadassHeightConstraint: NSLayoutConstraint {
override var constant: CGFloat {
set {
…

Fattie
- 27,874
- 70
- 431
- 719
2
votes
2 answers
IBDesignable drawings not displaying in storyboard
I am having an issue with IBDesignable elements not appearing in the storyboard view. It seems to be particular to my machine/version of Xcode (2015 11" Macbook Air running MacOS 10.14.4 and Xcode 10.2.1) and not an error in the code, as the same…

kamisama42
- 595
- 4
- 18
2
votes
1 answer
Xcode - Is there a way to disable all IBInspectable temporarily, to speed up Storyboard?
I really like IBInspectable and IBDesignable features, that allow to speed up things and have a better view of final result, directly in Storyboard. But Gosh…they slow down soooo much my storyboard loading, and makes it very laggy every time I edit…

AnthoPak
- 4,191
- 3
- 23
- 41
2
votes
1 answer
Get the type name of derived type in a static method of base class or extension Swift
TL:DR
Paste this into Swift playground:
import UIKit
public protocol NibLoadable {
static var nibName: String { get }
}
extension NibLoadable where Self: UIView {
public static var nibName: String {
return String(describing: self)
…

zaitsman
- 8,984
- 6
- 47
- 79
2
votes
1 answer
IBDesignable class not updating in xcode
I have created a custom IBDesignable UISegmentedControl class.
The class has no build errors but has warnings, it does not update inside of Xcode. There are the warnings, see the screenshot below.
@IBDesignable open class…

daviddna
- 163
- 2
- 7
2
votes
1 answer
IBDesignable for UIButton, IBInspectable vars are nil
I am having a strange problem with UIButton. I have the following custom class:
import UIKit
@IBDesignable class ToggleButton: UIButton {
@IBInspectable var state1Image: UIImage = UIImage()
@IBInspectable var state2Image: UIImage =…

Kex
- 8,023
- 9
- 56
- 129
2
votes
1 answer
why the autolayout is not updated if I use IBDesignable file when i run the app?
here is the project of this problem in the google drive: https://drive.google.com/file/d/1Js0t-stoerWy8O8uIOJl_bDw-bnWAZPr/view?usp=sharing
I make a custom navigation bar (the red view in the picture below) using IBDesignable code below. I want, if…

sarah
- 3,819
- 4
- 38
- 80
2
votes
2 answers
How to create an IBDesignable custom UIView from a UIBezierPath?
I want to shape a UIView and be able to see its shape in the Interface Builder, when I set the following class to my UIView it fails to build, I'm not sure where's the error.
@IBDesignable
class CircleExampleView: UIView {
override func…

Jonathan Solorzano
- 6,812
- 20
- 70
- 131
2
votes
0 answers
At which order Interface Builder evaluates IBInspectables?
I have custom UI element designed with a help of IBInspectables, so that I can use and modify it in the Interface Builder. There are 2 inspectables which effectively change the same property of the element but in a slightly different manner.
At…

markvasiv
- 522
- 2
- 16
2
votes
4 answers
Swift IBInspectable didSet versus get/set
I am relatively new to IBDesignables and IBInspectable's and I noticed that a lot of tutorial use IBInspectable in this fashion.
@IBInspectable var buttonBorderWidth: CGFloat = 1.0 {
didSet {
updateView()
}
}
func updateView() {
…

Saik
- 993
- 1
- 16
- 40
2
votes
1 answer
Use of setter getter from another view controller
I've already created a CustomView(.Xib) with it's class(.Swift).
In order to reach it's views (widgets) property I've defined several getter and setter and for now I need to call them to modify but when I make an object from the class I can't modify…

Mamad Farrahi
- 394
- 1
- 5
- 20