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
2
votes
0 answers

Is it possible to add and hide IBInspectable variables dynamically?

In the Pretty View example. If I Set Status to off, can I hide the other @IBInspectable string variables? And vice-versa to reveal them when toggling back to on. Is this possible? Pretty View IBInspectable variables :-
TyrantBoy
  • 67
  • 1
  • 6
2
votes
1 answer

Trying to create a rounded corner UIButton class

I am trying to create a rounded corner UIButton class but it is not working. This is what I have so far: interface #import IB_DESIGNABLE @interface BotaoCantosArredondados : UIButton @property (nonatomic, assign) IBInspectable…
Duck
  • 34,902
  • 47
  • 248
  • 470
2
votes
1 answer

Sse IBInspectable and IB_DESIGNABLE Bug changes not show in storyboard?

I reading this article IBInspectable / IBDesignable and flow step,But I found change not immediately rendered on storyboard.Can anyone known why? My Xcode Version:7.1 My main code: ViewController.h #import IB_DESIGNABLE @interface…
user5777248
2
votes
1 answer

@IBInspectable not updating Story Board

My custom button below works fine on the iOS Simulator - when I set a rotation in Interface Builder it rotates the button when I run the app. However, I can't see the rotation in the Story Board - it just shows the button without applying the…
henrikstroem
  • 2,978
  • 4
  • 35
  • 51
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
1 answer

Create max character length in UITextField using IBInspectable

I want to create a max length to my textfield with IBInspectable, I see a answer to this on a question here but I'm getting an error saying Expression type '()' is ambiguous without more context, My code was import UIKit private var __maxLengths =…
Dylan
  • 1,121
  • 1
  • 13
  • 28
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
1 answer

Remove @IBInspectable error: Failed to set () user defined inspected property on (UIView)

I added an @IBInspectable property named style as an extension to UIView. I refactored it because it interferes with UITableView.style. I am getting this error, I know exactly what the error means, but can't figure out how to actually stop it…
Matthew Mitchell
  • 514
  • 4
  • 14
1
vote
0 answers

Xcode Storyboard Fail to show (render) ViewControllers (The agent crashed)

I'm running Xcode Version 10.2.1 (10E1001) on MacBook Pro 2016 Processor: 2.6 GHz Intel Core i7 Memory: 16 GB 2133 MHz LPDDR3 Graphic: Radeon Pro 450 2 GB and Intel HD Graphics 530 1536 MB Storage: 256GB SSD Free Storage: 45GB SSD When i try to…
Mohammad Reza Koohkan
  • 1,656
  • 1
  • 16
  • 36
1
vote
3 answers

CornerRadius and Shadow on a UIView using @IBInspectable Swift 4.2

Is it possible to have both CornerRaduis and a shadow on a UIView? I set up a Custom class for a UIView which uses @IBInspectable to set a cornerRadius and a addShadow which can be true or false. When I set the cornerRadius the shadow doesn't…
Matthew Mitchell
  • 514
  • 4
  • 14
1
vote
2 answers

how to corner Radius some edges in IBInspectable in swift 4?

so here is the code that is working well let path = UIBezierPath(roundedRect:viewToRound.bounds, byRoundingCorners:[.topRight, .bottomLeft], cornerRadii: CGSize(width: 20, height: 20)) let maskLayer =…
Saeed Rahmatolahi
  • 1,317
  • 2
  • 27
  • 60
1
vote
0 answers

Set UINavigationBar's gradient color using IBInspectable

So this is my custom class for UINavigationBar : import UIKit @IBDesignable class GradientNavigationBar: UINavigationBar { @IBInspectable var firstColor: UIColor = UIColor.clear { didSet { updateView() } } …
Nitish
  • 13,845
  • 28
  • 135
  • 263
1
vote
1 answer

Swift @IBInspectables with priority choose the order are they executed in

I am playing a bit with @IBInspectables. I have created a reusable custom View which has some @IBInspectables. Is there no way to give priority to the @IBInspectables to get executed? In the following case to modify the color or the font of the…
Pablo Sanchez Gomez
  • 1,438
  • 16
  • 28
1
vote
0 answers

@IBInspectable: Property cannot be marked

I keep getting this error: Property cannot be marked @IBInspectable because its type cannot be represented in Objective-C .. why does its type need to be represented in Ojective-C? And is there a simple way to solve this problem? This is the…
user3138007
  • 637
  • 1
  • 6
  • 19
1
vote
2 answers

Apply IBInspectable to all view types in iOS

I'm trying to apply IBInspectable to all types of view like UIView, UIButton, UITextField, UIImageView, etc. Here's what I did: @IBDesignable class BaseView: UIView { override func layoutSubviews() { super.layoutSubviews() …
D4ttatraya
  • 3,344
  • 1
  • 28
  • 50
1 2 3
8 9