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

EXC_BAD_ACCESS Using IBInspectable

I am trying to use IBInspectable to add borders to my views. extension UIView { private func getBorder(integer: Int) -> UIRectEdge { if integer == 1 { return .top } else if integer == 2 { return .left …
Pranav Wadhwa
  • 7,666
  • 6
  • 39
  • 61
0
votes
0 answers

How to pass delegate to a UITextField inside an IB_DESIGNABLE?

I have created a custom view and added a UITextField to it.My question is: How can I add a delegate so that the you can set it as the default cmd+drag behaviour of XCode? My current attempt is by doing something like this: In my .h file: #import…
Laur Stefan
  • 1,519
  • 5
  • 23
  • 50
0
votes
1 answer

Dynamic IBInspectable enum in iOS

I'm writing custom control with segments (like UISegmentControl) I have to use IBInspectable params. I have number of controls @property IBInspectable int numberOfSegments; And here how I draw this segments: -(void) drawForAmountOfSegments { …
Arthur
  • 1,740
  • 3
  • 16
  • 36
0
votes
1 answer

IBInspectable property values not updating in xib

I'm running into a minor complication using IBInspectable properties and not sure if it might have something to do with my xibs and xib usage. I'm trying to reuse a custom control between multiple view controllers. The control is a custom tab…
zic10
  • 2,310
  • 5
  • 30
  • 55
0
votes
0 answers

IBDesignable: render a UIView in storyboard using IBInspectable an UIImage - Objective C

I'm creating a UIView that allows the user to vote using a classical 5 stars rate system. My code works and everything is fine but I would like to make a preview on the storyboard using IBInspectable variables. I really do not know how to achieve…
DungeonDev
  • 1,176
  • 1
  • 12
  • 16
0
votes
1 answer

How do I use IBDesignable/IBInspectable with CocoaPods in an Objective-C only project

My project is Obj-C only. Via Cocoapods, I tried installing an Obj-C library that takes advantage of IBDesignable and IBInspectable. If I add that project to my library and run 'pod install' I get two errors when building/running: error: IB…
0
votes
1 answer

iOS : Inifinite Loop setting rightView's frame of UITextField with IBInspectable attribute

I inherits my "MFTextField" class from UITextField. I want to customize the frame of the "rightView" property of the UITextField with an IBInspectable property from Interface Builder. To do that : IB_DESIGNABLE @interface MFTextField : UITextField…
QLag
  • 823
  • 1
  • 13
  • 33
0
votes
3 answers

Deleted IBInspectable property generates warning logs

I was using a couple of @IBInspectable properties on my class after which I changed my mind and deleted them. Although, it seems IB is still trying to set them and each run generates warnings like: 2015-03-04 11:47:10.288 2D[29075:939900] Failed to…
Youssef Moawad
  • 2,846
  • 5
  • 28
  • 50
0
votes
1 answer

Using multiple UITableViews in a XIB

I have created a custom widget as a XIB file where I have multiple UITableViews and a UIButton. In the corresponding swift file which is the owner of this XIB, I have outlets to these TableViews. I have added this widget to a view inside a view in a…
rgamber
  • 5,749
  • 10
  • 55
  • 99
-1
votes
1 answer

IBInspectable stored property in extension

I would like all subclasses of UIView to have a stored property IBInspectable. Unfortunately I can't use an extension of UIView, because in an extension, an IBInspectable cannot be a stored property. The best solution I have right now is to create…
Michael Lee
  • 339
  • 3
  • 11
-1
votes
1 answer

Interface Builder show all @IBInspectable in cascade

I'm maybe too complicated, but here is what I want: @IBDesignable class A: UIView { @IBInspectable var title: String = "" { didSet { setNeedsLayout() } } } @IBDesignable class B: UIView { var firstView: A =…
Dam
  • 579
  • 6
  • 22
1 2 3
8
9