OC高效率52之使用清晰协调的命名方式

#import <Foundation/Foundation.h>
/**
 *  1.起名时应听从标准的OC命名规范,这样建立出来的接口更容易为开发者所理解。
 *  2.方法名要言简意赅
 *  3.方法名里不要使用缩略后的类型名称
 *
 */
//好的命名方式:
@interface EOCRectangle : NSObject
@property (nonatomic , assign , readonly) float width;
@property (nonatomic , assign , readonly) float height;
-(id)initWithWidth:(float) width andHeight:(float)height;
-(EOCRectangle *)unionRectangle:(EOCRectangle*)rectangle;
@end
相关文章
相关标签/搜索