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
0
votes
1 answer

IB_DESIGNABLE and IBINSTECTABLE UIImageView

I'm trying to add a custom property to my subclass of UIImageView. The property type is of UIImageView. I have success with other data types, UIColor, int, etc. But UIImageView just doesn't appear in the custom fields of the interface builder and I…
noodlez
  • 89
  • 8
0
votes
1 answer

custom SKSpriteNode classes for use in .sks file?

I'm making a custom SKSpriteNode Class, which I want to use in my .sks file. I want it to have @IBInspectable property. Is it possible? And how can I implement its init(coder:) method, or there is no need to implement it?
Fayyouz
  • 682
  • 7
  • 18
0
votes
1 answer

Add attributes for UITableViewController

I'm developing a custom class. The goal is user will add a UITableViewController to the storyboard and set its class to mine. and my class will fill the tableView. Here's my question: I want to give the user to set some attributes like header color,…
0
votes
2 answers

is @IBInspectable var did set value in which phase

this is my code @IBDesignable class BarPopView: UIView { @IBInspectable var ft: NSString = "1" @IBInspectable var ffPrompt: NSString = "Area" override init(frame: CGRect) { super.init(frame: frame) setupView() } …
Water Magical
  • 979
  • 1
  • 9
  • 13
0
votes
1 answer

Call @IBInspectable set in @IBDesignable after layer is updated by constraints

I want to make an @IBInspectable for UIView that makes UIView as a circle: @IBInspectable var circleBorder: Bool { set { layer.cornerRadius = layer.frame.size.width / 2 } get { return layer.cornerRadius > 0 ? true : false …
Roo
  • 613
  • 1
  • 7
  • 24
0
votes
1 answer

How can I make a custom subclass of uitextfield and over there using @IBDesignable & @IBInspectable I can set placholder padding from left

I want to make a subclass of UITextField and over there by using @IBDesignable and @IBInspectable set the left side as well as right side padding for the text as well as placeholder. Can ignore left and right view.
SAM
  • 54
  • 9
0
votes
2 answers

Using @IBDesignable for a gradient view

I am using the below to create a gradient view that is visible in IB: import UIKit import QuartzCore @IBDesignable class FAUGradientView: UIView { @IBInspectable var firstColor:UIColor = UIColor.clear @IBInspectable var…
0
votes
1 answer

Swift multiple inheritance solution for IBInspectable/IBDesignable?

I've been playing with the IBInspectable/IBDesignable like in this article: http://nshipster.com/ibinspectable-ibdesignable/. It shows how you can make an extension to add extra editing options in storyboard. The problem however is that you can't…
Janneman
  • 1,093
  • 15
  • 23
0
votes
1 answer

Swift, is it possible to have an IBInspectable block?

I have approximately 50 properties in my view that I must make inspectable. Is there a way to do so without declaring it explicitly for each one?
Makaronodentro
  • 907
  • 1
  • 7
  • 21
0
votes
0 answers

TextView Border Color and Border Radius Not Set

I want to set corner Radius of UITextView By Interface . But I am unable to do this . This code Work Fine for UILabel, UIButton but give error in UITextView Intializer does not override a designated intializer from superclass. class MyText:…
Rishab
  • 31
  • 5
0
votes
1 answer

Why properties tagged @IBInspectable is not working?

I followed the tutorial here to create an inspectable and designable view. I just want to add border color, border width, and rounded border capability into the UIView. I have been successful to show the properties. But doesn't matter what I set on…
Chen Li Yong
  • 5,459
  • 8
  • 58
  • 124
0
votes
2 answers

How to get IBInspectable var value with get return?

I have simple rating app and i have; @IBInspectable var commingId: Int { get { return self.commingId; } set { refreshStars() } } func…
SwiftDeveloper
  • 7,244
  • 14
  • 56
  • 85
0
votes
1 answer

iOS - What Objective-C Methods Do I Need To Make IBInspectable Work?

This is the following code I have for a custom UIView class I made where you can control it's shadows in the interface builder: #import "ShadowView.h" @interface ShadowView () @property (copy, nonatomic) IBInspectable UIColor…
Rafi
  • 1,902
  • 3
  • 24
  • 46
0
votes
1 answer

Clean interface builder compilation

I want to use IBDesignable and IBInspectable to display some custom views. Everything worked fine until it I made some errors. I fixed them but the Interface builder still renders an old state of the view. My guess is that it is using some old…
Jelly
  • 4,522
  • 6
  • 26
  • 42
0
votes
1 answer

Why isn't this IBInspectable property editable in Interface Builder?

I have an @IBDesignable class with the following property: @IBInspectable var isSelected = false { didSet{ self.delegate?.toggleViewToggled(selected: isSelected, object: self) self.setNeedsDisplay() } } But in Interface…
Rogare
  • 3,234
  • 3
  • 27
  • 50
1 2 3
8
9