It is not possible to limit what the user can enter into the storyboard. However, you can prevent the storage of invalid values ββusing a computed property:
@IBInspectable var shapeType: Int { set(newValue) { internalShapeType = min(newValue, 3) } get { return internalShapeType } } var internalShapeType: Int = 0
Then you can also use enum instead of constants to represent different types of shapes inside.
Ben-g source share