Introduce IBOutlet-like type qualifier for user-defined runtime attributes

Originator:defagos
Number:rdar://16404208 Date Originated:24-Mar-2014
Status:Duplicate Resolved:
Product:iOS SDK Product Version:
Classification:Improvement Reproducible:
 
Description:
User-defined attributes are a welcome addition to Xcode, but they are not really convenient to use. You namely have to enter a valid key path manually (without autocompletion), then to choose the appropriate type (string, number, etc.), which is error-prone.

It would be extremely convenient to introduce, as for outlets (IBOutlet) or actions (IBAction), a type qualifier IBAttribute (or equivalent) to mark properties intended to be set via user-defined runtime attributes. I suggest adding an optional friendly description string right after the IBAttribute qualifier, e.g.

    @property (nonatomic, copy) IBAttribute(Placeholder Text) NSString *placeholderText;
    @property (nonatomic, assign, getter=isBordered) IBAttribute(Display Border) BOOL bordered;
    @property (nonatomic, strong) IBAttribute UIColor *lineColor;

This could have several benefits:
  1) More expressiveness: Attributes meant to be set in Xcode would be easy to recognize
  2) Direct Xcode integration: Instead of having the user provide the key path and the type manually, this information could be readily made available in Xcode, e.g. directly below the existing user-defined attribute table (see attached mockup). The optional IBAttribute friendly description can be used as introductory label when available. The type of the property determines how each value is set (a text field for NSString, a checkbox for BOOL, a color picker for UIColor). Alternatively, you might consider displaying those attributes as they currently are (table), but providing autocompletion based on identified IBAttributes.

Steps to Reproduce:
-

Expected Results:
-

Actual Results:
-

Version:
iOS 7.0.3 (11B511)

Notes:
-

Configuration:
-

Comments

Duplicate of 15797944


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!