Remove @IBInspectable error: Failed to set () user defined inspected property on (UIView)

559 views Asked by At

I added an @IBInspectable property named style as an extension to UIView. I refactored it because it interferes with UITableView.style. I am getting this error, I know exactly what the error means, but can't figure out how to actually stop it looking for style. It doesn't cause a fatal error, but it is very annoying. Does anyone know how to remove it?

My refactored @IBInspectable code:

// Global variable to produce a unique address as the AssociatedObjectHandle
var AssociatedObjectHandle: UInt8 = 0

public extension UIView {

    @IBInspectable var styleName: String {
        get {
            return objc_getAssociatedObject(self, &AssociatedObjectHandle) as? String ?? ""
        }
        set {
            objc_setAssociatedObject(self, &AssociatedObjectHandle, newValue, objc_AssociationPolicy.OBJC_ASSOCIATION_RETAIN_NONATOMIC)
        }
    }
}

I have tried:

1: Clean and build

2: Deleting the emulator files

3: Quitting XCode

1

There are 1 answers

1
Matthew Mitchell On

Needed to remove the property from the User Defined Runtime Attributes, in the Identity Inspector on the Storyboard. Figured this out, shortly after posting the question.

As shown below:

enter image description here