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
1
vote
1 answer

Do I have to hard code the values adjusted by an IBInspectable property?

If I use IBInspectable to adjust the properties and get live updates on Xcode, do I then I have to hard code the values I chose or will the adjusted values be compiled with the final version? I mean, suppose I use IBInspectable to adjust the border…
Duck
  • 34,902
  • 47
  • 248
  • 470
1
vote
1 answer

IB_DESIGNABLE Class not rendering on Interface Builder

This is my first try with IB_DESIGNABLE on Xcode. I have this class to add color to a NSView. header #import IB_DESIGNABLE @interface NSViewComCor : NSView @property (nonatomic, weak) IBInspectable NSColor…
Duck
  • 34,902
  • 47
  • 248
  • 470
0
votes
1 answer

@IBDesignable preview in IB again broken under XCode 14.2 on M2?

I receive the error: .../Base.lproj/MainMenu.xib Failed to render instance of : dlopen(....app, 0x0001): tried: '/...' (no such file), '....app' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')),…
0
votes
0 answers

How to take input from Storyboard for an arrays individual index

I am building a custom Segmented controll. Now I would like to take title or image for individual segment from storyboard like segment @IBInsepctable properties of UISegmentControll. I can do it for a single value, like @IBInspectable var…
0
votes
0 answers

Failed to render and update auto layout

I am using Xcode 13.4.1 in Rosseta mode on Macbook Pro (M1 chip) running macOS Monterey v12.0. Basically, IBDesignable views are not getting updated in XIB and throwing weird errors. All the details are in the screenshot attached. Note: When I open…
dev gr
  • 2,409
  • 1
  • 21
  • 33
0
votes
1 answer

UIImage not resizing according to UIImageView size width and height

I am a Swift newbie and I am trying to add an UIImageView on the right of UITextField using Storyboard and @IBInspectable annotation. However, when I define my UIImageView with specific size and add the UIImage, the UIImage is not resizing according…
0
votes
0 answers

how to correctly calculate corneRadius of a XIB in swift

cannot set calculated value for the roundedCorners of this xib. only works if Hard coded. So do you have solution? and more generally speaking, is this a good way to make a xib? this works, but is hard coded self.contentView.layer.cornerRadius =…
biggreentree
  • 1,633
  • 3
  • 20
  • 35
0
votes
1 answer

Use @IBInspectable with any UIView subclass within storyboards

I have a class to use with @IBInspectable, to get the properties within my storyboard. Here is a small chunk of it: /// UIView subclass to allow creating corners, shadows, and borders in storyboards. final class GEView: UIView { // MARK: -…
George
  • 25,988
  • 10
  • 79
  • 133
0
votes
0 answers

IBInspectable: extracting data from value failed

I have built a library that adds a view to the screen and allows the developer to customize its appearance by entering custom values in IBInspectable fields. It used to work just fine, except when I added the localizable branch. I noticed that the…
LinusGeffarth
  • 27,197
  • 29
  • 120
  • 174
0
votes
0 answers

Subclassing UISlider to customize thumb image using IBDesignable/IBInspectable?

I'm using this code from to customize my UISlider's thumbImage. It builds correctly in the storyboard but when I build and run it does not show my image? Could it be because I have it hooked up as an outlet as well? (necessary because I need to set…
GarySabo
  • 5,806
  • 5
  • 49
  • 124
0
votes
0 answers

How can you give design-time layout support to a custom UIView?

Just playing around to see if something can be done. I know I can give design-time support to certain properties by adding @IBInspectable to them, and I'm also aware of making the view itself support design-time rendering and display by marking the…
Mark A. Donohoe
  • 28,442
  • 25
  • 137
  • 286
0
votes
2 answers

Unable to see the IBInspectable custom properties in Storyboard of the custom view class

I have created custom UIView class with IBDesignable method enable in it. Inside the class, I have added few IBInspectable properties looks something like this, Swift 4.0 - Snippet: @IBDesignable class SegmentView: UIView { @IBInspectable var…
0
votes
1 answer

IBInspectable run setup function every time IBInspectable value changes

I have an IBDesignable class which has an IBInspectable value: Int value is basically the number of balls shown within the IBDesignable class so I have a setup() func which adds the correct imageViews (one for each ball) using for _ 0 ..< value {…
TheBearF8
  • 375
  • 1
  • 3
  • 14
0
votes
0 answers

Add RightView UIButton in UITextField Using IBInspectable

Is it possible to add rightView UIButton to a UITextField to StoryBoard using @IBInspectable ? I want to create a uiTextfield like in this image using StoryBoard so that it will be easier in the future So far I was able do this IBDesignable Class…
alpha47
  • 305
  • 3
  • 17
0
votes
2 answers

How can I add section names in the Attributes inspector in Xcode?

Is there any way to add section name in newly added @IBDesignable properties for better readability. // //MARK: - Badge // @IBInspectable var badgeColor:UIColor = UIColor.darkGray { didSet { updateView() } } @IBInspectable var…
iamVishal16
  • 1,780
  • 18
  • 40
1 2 3
8 9