Questions tagged [ibinspectable]

IBInspectable is a keyword that enables a property to be set from Xcode Interface Builder.

IBInspectable is a keyword that enables a property to be set from Xcode Interface Builder.

Sample Objective-C usage:

@property IBInspectable float myCustomProperty;

Sample Swift usage:

@IBInspectable public var myCustomProperty:float = 1.0

See also:

131 questions
96
votes
11 answers

IB_DESIGNABLE, IBInspectable -- Interface builder does not update

I have the following set of code: CustomView.h #import IB_DESIGNABLE @interface CustomView : UIView @property (nonatomic) IBInspectable UIColor *borderColor; @property (nonatomic) IBInspectable CGFloat borderWidth; @property…
nhgrif
  • 61,578
  • 25
  • 134
  • 173
68
votes
5 answers

How to set default values for IBInspectable in Objective-C?

I know default values of IBInspectable-properties can be set as: @IBInspectable var propertyName:propertyType = defaultValue in Swift. But how do I achieve a similar effect in Objective-C so that I can have default value of some property set to…
Can Poyrazoğlu
  • 33,241
  • 48
  • 191
  • 389
27
votes
8 answers

IBDesignable Build Failed

I have Created IBDesignable and IBInspectable custom class to give shadow and corner radius for view But When I assign Designable class to view, I get Designable Build Failed This is my code import Foundation import UIKit @IBDesignable class…
VishalPethani
  • 854
  • 1
  • 9
  • 17
20
votes
5 answers

Can you add IBDesignable properties to UIView using categories/extensions?

For those that don't know what I'm talking about, Xcode 6.0 added new features, IBDesignable and IBInspectable. When you tag your custom views with IBInspectable properties, those properties show up in the Attributes Inspector in IB. Likewise, when…
Duncan C
  • 128,072
  • 22
  • 173
  • 272
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
1 answer

IBInspectable UIEdgeInsets not shown in IBOutlet

I am creating a custom class for UIButton to increase the tap area. I need that user can enter the padding in storyboard itself. So I make a IBInspectable property. @IBDesignable class UIIconButton: UIButton { @IBInspectable var…
Saurav Nagpal
  • 1,247
  • 1
  • 10
  • 27
11
votes
1 answer

Asset Catalog named colors are not available to @IBInspectable properties

For my iPad app that I'm creating, I have an Asset Catalog in my project containing several color sets. I know that I can drag and drop these into the code itself and have done so for the default color of an @IBInspectable class property. However,…
11
votes
2 answers

IBInspectable Properties not showing up in Xcode 8.3.3

While attempting to modify the Apple tutorial found here on IBinspectable properties for my own project I have run into a major roadblock. I defined a simple button subclass: import UIKit @IBDesignable public class SocialMediaLoginButton: UIButton…
user4592495
11
votes
2 answers

Global Color Palette for Interface Builder

In swift i'm writing an extension (like Obj-C category) that maintains in code class methods of "house colors." I'm wondering if there is a way to make this color extension accessible to Interface builder using IBInspectable or something else as…
esreli
  • 4,993
  • 2
  • 26
  • 40
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
10
votes
2 answers

Static library, bundle and IB Designable

I'm trying to use the IB Designable and IB Inspectable in my UIButton but seems there are some errors. In the Issue Navigator, the bundle file: Storyboard : IB Designables : Failed to update auto layout status: Failed to load designabled from…
user4203923
9
votes
1 answer

How can we create IBInspectable like checkmark?

I created lots of IBInspectable. But today, I observed that Xcode having some properties like this: In the link, I marked rectangle box. I want to create custom IBInspectable like that. I don't know that is possible or not. Any help would be…
9
votes
1 answer

How to document an @IBInspectable property in Xcode

In my custom UIView I have a property that I expose to the storyboard with @IBInspectable. /** My custom property documentation. */ @IBInspectable var myProperty: Double = 2.5 Is there a way to show a documentation when a user hovers the cursor…
Evgenii
  • 36,389
  • 27
  • 134
  • 170
1
2 3
8 9