Questions tagged [ibdesignable]

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.

279 questions
1
vote
1 answer

IBDesignable custom NSControl class - frame not resizing in Interface Builder

This is for macOS, not iOS ... thank you. I have a very simple custom slider control that has 2 @IBInspectable properties - trackHeight and knobHeight. I want my control's frame in Interface Builder to resize in response to those 2 properties…
waldenCalms
  • 100
  • 1
  • 8
1
vote
0 answers

Custom UIView with IBDesignable UIView inside not showing in app

I'm trying to create a UIView with this style: I made the circles using an @IBDesignable class, using the code in this answer: import UIKit @IBDesignable class CircleView: UIView { private var shapeLayer = CAShapeLayer() @IBInspectable var…
Frakcool
  • 10,915
  • 9
  • 50
  • 89
1
vote
1 answer

How to make editable values in storyboard using IBDesignable class?

I'm wondering how to create reusable @IBDesignable class for UITextView with which I could change border width, colour, etc. directly from the Storyboard? Thanks in advance!
sushi
  • 157
  • 1
  • 7
1
vote
1 answer

Very Strange Errors From IB During Build With Swift Package, Using IBDesignable

I have developed this shared package. It works fine. In the package test harnesses (3 iOS apps), it works great, and also, the IB storyboard renders the control (It's an IBDesignable). However, when I include it as a package in another app (I can't…
1
vote
2 answers

Custom @IBDesignable UIButton crashes Xcode

I wanted to design a rounded button with a shadow for my iOS project in Swift. So I came up with the following custom button class: import UIKit @IBDesignable class MainButton: UIButton { private var shadowLayer: CAShapeLayer! override…
Nawabu
  • 37
  • 6
1
vote
1 answer

Trouble with IBInspectable and loading a view from xib for Interface Builder

I have a custom class with its own .xib. I'm trying to incorporate IBInspectable to change the color of its background and subviews' backgrounds in IB. In IB, when I leave 'Custom Class' blank, and add the User Defined Runtime Attribute 'bgColor'…
Paul
  • 115
  • 2
  • 10
1
vote
2 answers

IBDesignable's only render in Storyboard, not in standalone XIB's

I haven't read anywhere yet if this is normal, but I can't get IBDesignable views to render in a standalone xib, such as a custom view or even a TableViewCell. When I put them in a storyboard, they render perfectly fine. Here's an example for…
1
vote
1 answer

constraints in prepareForInterfaceBuilder?

I'm no great fan of @IBDesignable, but in playing around with it I find that if you add a subview in prepareForInterfaceBuilder, the subview is added but constraints that you apply to it are not obeyed. Is this a known limitation of…
matt
  • 515,959
  • 87
  • 875
  • 1,141
1
vote
1 answer

IBDesignable's custom background color property doesn't update based on the target

I am running into an extremely specific problem with XCode. Setup Equally named Colors different in Targets I have two targets in my XCode project, Target A and Target B. They both have an individual assets folder named Colors.xcassets with a color…
TomQDRS
  • 875
  • 1
  • 7
  • 20
1
vote
3 answers

IBDesignable class don't seems to work properly

I'm building a new iOS app with swift and trying to make a custom IBDesignable UIButton class to use in the designer. My code does not seems to work either in the builder or the app itself at runtime. The default value i gave to the IBInspectable…
Eitana Aviv
  • 103
  • 1
  • 4
1
vote
2 answers

Xcode @IBDesignable Button Background Color Not Rendering In Storyboard

Trying to show the button background color in the storyboard, the following code renders the border width and radius correctly but background doesn't show. In the simulator, the button's background color is rendered correctly. import UIKit let…
Raj
  • 35
  • 9
1
vote
1 answer

IB Designables Failed to render and update auto layout status : dlopen(Cosmos.framework, 1): no suitable image found

I had successfully integrated 3rd party Library in Swift 3, Xcode Version 8.3.3, CocoaPods: pod 'Cosmos', git: 'https://github.com/marketplacer/Cosmos.git', tag: '8.0.2'. However, today it stopped working as expected. I get 3 errors in the issue…
bibscy
  • 2,598
  • 4
  • 34
  • 82
1
vote
2 answers

how to insert image in the left AND right to textfield using @IBDesignable in swift?

I am a beginner, I am trying to make a password textfield with two image, one on the left side (lock image) and another one on the right side to reveal the password like this one but my senior ordered me to make it in the @IBDesignable class of…
maximiliano
  • 353
  • 5
  • 15
1
vote
1 answer

how to make designable textfield code class in swift

I am a beginner in programming and in iOS development. I want to make a swift file that contains a code to make Designable textfield, so I will not edit the UI element display by coding, all the UI that will be edited, I will edit it in Interface…
Alexa289
  • 8,089
  • 10
  • 74
  • 178
1
vote
1 answer

how to make Designable UIImage in Swift

I am a beginner. I want to make a swift file that contains a code to make Designable UIImage, so I will not edit the UI element display by coding, just in Interface builder by assigning this swift file to UI class. I can do something similar in…
Agung Laksana
  • 781
  • 1
  • 12
  • 26