30 lines
634 B
Plaintext
30 lines
634 B
Plaintext
Shared coding conventions allow teams to collaborate efficiently. This rule checks that curly braces are omitted from interfaces with no instance variables.
|
|
|
|
|
|
Using curly braces in such a situation means that the reader of the code must pause to find the close curly brace before understanding that there are no variables. On the other hand, omitting the curly braces is a quick, clear indicator that there are no variables.
|
|
|
|
|
|
== Noncompliant Code Example
|
|
|
|
----
|
|
@interface Foo : NSObject { // Noncompliant
|
|
}
|
|
|
|
-(void) doSomething;
|
|
|
|
@end
|
|
----
|
|
|
|
|
|
== Compliant Solution
|
|
|
|
----
|
|
@interface Foo : NSObject
|
|
|
|
-(void) doSomething;
|
|
|
|
@end
|
|
----
|
|
|
|
|