1

Is there a way to delimit values on IBInspectable var or change how much the value increases or decreases?

For example, suppose that I have the following var:

@IBInspectable public var percentage:CGFloat = 0.0

I want to delimit from 0.0 to 1.0.

I was wondering because I can do it on alpha values:

alpha

And when I click on the upper arrow it adds 0.05 on its value.

kobuchi
  • 420
  • 5
  • 11
  • Seems like [this is not possible (yet?)](http://stackoverflow.com/questions/30831609/how-to-set-a-max-limit-for-an-ibinspectable-int), and that the increments of `number` type `@IBInspectable`:s will always be by integer steps (from starting value). You can naturally limit the actual binded values by property observers or a layer of stored property -> `@IBInspectable` computed property, but these will not ping back any limitations to the attributes inspector. Similar unanswered question [here](http://stackoverflow.com/questions/27692868/configuring-ibinspectable-attribute-inspector-controls). – dfrib Apr 05 '16 at 15:10
  • you can't do such thing at this time AFAIK. – holex Apr 05 '16 at 16:18

0 Answers0