Xcode 8.1: IBInspectable property does not appear in IB if an @objc name is specified after @IBInspectable

Originator:igeek1
Number:rdar://28673564 Date Originated:07-Oct-2016 02:08 PM
Status:Open Resolved:
Product:Developer Tools Product Version:Xcode 8.1 beta (8T46g)
Classification:UI/Usability Reproducible:Always
 
Summary:
When mixing @IBInspectable and @objc on a single property, order appears to matter in whether the inspectable UI will appear in IB.

Steps to Reproduce:
1. Create a Swift iOS single-view app from the Xcode template.
2. Add the following snippet (ugly wrapping for Radar purposes only):

extension UILabel {

    @IBInspectable
    @objc(myPropertyObjC)
    public var
    myProperty: String {
        get {
            return "foo"
        }
        set {
            
        }
    }
}

3. Open Main.storyboard in the storyboard editor, a.k.a. “IB”.
4. Drag out a UILabel to the storyboard.
5. Look for the myProperty inspectable interface at the top of the Attributes Inspector.

Expected Results:
An editor for “My Property” will appear at the top of the Attributes Inspector.

Actual Results:
No such editor appears.

Regression:
Unknown, but reproducible in Xcode 8.0 and 8.1b2.

Notes:
To make the editor UI appear in IB, swap the @IBInspectable line with the @objc line:

    @objc(myPropertyObjC)
    @IBInspectable
    public var
    myProperty: String {

Now the “My Property” editor will show up in IB.

Example project also uploaded here: https://cl.ly/hhmF

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!