Swift enums backed by primitive types should be IBInspectable

Originator:marcelofabri.mf
Number:rdar://33586210 Date Originated:28-Jul-2017 10:20 AM
Status:Open Resolved:
Product:Developer Tools Product Version:Xcode 9 beta 4
Classification:UI/Usability Reproducible:Always
 
Summary:
This is a duplicate of radar #33583799

When you define a Swift enum, backed by a String or Int, it would be very useful if you could use them in Interface Builder with @IBInspectable.


Steps to Reproduce:
1. Create a Swift enum like this one, that defines how important the modal being presented is relative to other modals:

```
enum ModalPriority: Int {
    case low = 0, medium, high, critical
}
```

2. Add a property to a custom UIViewController subclass like this:

```
@IBInspectable var priority: ModalPriority = .low
```

3. Attempt to set this property in IB

Expected Results:
You get a NSPopUpButton with the cases from the enum

Actual Results:
This property isn't exposed in IB

Version:
Xcode 9 beta 4

Notes:

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!