Is the iOS convention not functions and indentation properties defined inside a block?
Is it an iOS convention not to indent properties, functions, etc. defined by a block?
For example, defining properties inside an interface in a .h file looks like this:
@interface XYZAddToDoItemViewController : UIViewController
@property XYZToDoItem *toDoItem;
@end
In other languages ββI'm used to (ruby, php, python, js) it will look like this:
@interface XYZAddToDoItemViewController : UIViewController
@property XYZToDoItem *toDoItem;
@end
Is this an agreement? @property in the correct @interface block?
For Objective-C interfaces, the definition block is between @interface
and @end
. All properties go there.
The convention doesn't really apply to indentation elements in an interface definition.
In particular, it's interesting to see the Google Objective-C tutorial .
For some specific reason, as far as I know. I'm not backing down. However, you can also do this if you like and uninstall @property
.
@interface XYZAddToDoItemViewController : UIViewController {
XYZToDoItem *toDoItem;
}
@end