iOS编码

1.定义通知名字
类名+xxxx+Notification

在OC中定义在.m中,extern在.h中


2.定义枚举名字
类名+xxxx+style type...


3.注释都在后边//xxxx

4.setter写在后边

5.函数的return如果创建返回的话中间使用一个空格, 其他情况不用加空格


6 命名

@property (nonatomic, strong) UILabel *statusLabel;

@property (nonatomic, strong) CALayer *backgroundLayer;
@property (nonatomic, strong, readonly) NSTimer *fadeOutTimer;

@property (nonatomic, readonly) CGFloat visibleKeyboardHeight;

@property (strong, nonatomic) UIImage *errorImage UI_APPEARANCE_SELECTOR;   
@property (strong, nonatomic) UIView *viewForExtension UI_APPEARANCE_SELECTOR; 

@property (assign, nonatomic) UIOffset offsetFromCenter

@property (assign, nonatomic) SVProgressHUDStyle defaultStyle


方法名: 动词+xxxx

set reset update show pop dismiss push regist move create setup


定义数组,字典集合类型使用xxxs 如HTTPHeaders

定义Block
// 方法参数带Block


7 方法顺序相同功能,参数多的放在下边

+ (void)show ;

+ (void)showWithMaskType:(SVProgressHUDMaskType)maskType;


8 被调用的方法写在下边

updateHUDFrame {

[self updateBlurBounds];

}

updateBlurBounds {

}


9 注释一组的 使用/**/

/* The initializers available to subclasses. See further below for additional init methods.
*/

注释单个的使用

//

定义的枚举, .h中的属性 都要有注释



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值