Adds property declarations to generated Objective-C for annotated fields.
Can be used on a class, causing all methods without parameters to be converted to properties.
See Apple's @property documentation.
Notes:
- Invalid attributes are reported as errors.
- readwrite, strong (when using ARC), and atomic attributes are removed since they are defaults.
- Strings will include the copy attribute.
class Foo {
@Property("copy, nonatomic") protected String bar;
}
generates:
@property (copy, nonatomic) NSString *bar;Class Example:
@Property
class Foo {
public String getBar();
public String foo();
}
generates:
@property (copy, nonatomic, getter=getBar, readonly) NSString *bar; @property (copy, nonatomic, getter=foo, readonly) NSString *foo;
- Author:
- Harry Cheung
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic @interfacePrevents a method from being converted to a property when its class is annotated with `@Property`. -
Optional Element Summary
Optional Elements
-
Element Details
-
value
String value- Default:
""
-