How to create an IBInspectable of type enum

Swift 3 @IBInspectable var shape:StatusShape = .Rectangle merely creates a blank entry in Interface Builder: Use an adapter, which will acts as a bridge between Swift and Interface Builder. shapeAdapter is inspectable from IB: // IB: use the adapter @IBInspectable var shapeAdapter:Int { get { return self.shape.rawValue } set( shapeIndex) { self.shape = StatusShape(rawValue: shapeIndex) … Read more

IB_DESIGNABLE, IBInspectable — Interface builder does not update

Based on chrisco’s suggestion to debug the selected view (which I had already done, but went to try again for good measure), I noticed a couple of other options at the bottom of the Editor menu. Automatically Refresh Views Refresh All Views I clicked “Refresh All Views” and after Xcode had a bit of a … Read more

“Width equals height” constraint in Interface Builder

Update Xcode 5.1b5 Ctrl+click and drag from a view and release while the pointer is over the view. Select “Aspect Ratio”. It will create a constraint where the first and second item is the view. Before Xcode 5.1 You can’t because the width/height editor lacks the fields to relate to another property or set the … Read more