
协议
// 配置简写: __deleDeclare
/** <#Description#> */
@protocol <#DelegateName#> <NSObject>
@end
自定义主view
// 配置简写 __mainViewDeclare
/** <#Description#> */
@property (nonatomic, strong) <#UIView#> *mainView;
// 配置简写: __mainViewImple
- (<#UIView#> *)mainView
{
if (!_mainView) {
_mainView = [<#UIView#> new];
_mainView.frame = self.view.bounds;
}
return _mainView;
}
tableView 精简写法
// 配置简写: __tableDeleSimp
#pragma mark - delegate & datasource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return <#expression#>;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
return <#expression#>;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
return [UITableViewCell new];
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
NSLog(@"did selected index: %@",indexPath);
}
tableView复杂写法
// 配置简写: __tableDeleComp
#pragma mark - delegate & datasource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return <#expression#>;
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
return <#expression#>;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
return <#expression#>;
}
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{
return <#expression#>;
}
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
return <#expression#>;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
return [UITableViewCell new];
}
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
{
return nil;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
NSLog(@"did selected index: %@",indexPath);
}
tableView编辑
// 配置简写: __tableDeleEdit
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
{
if (indexPath.section == 0) {
return YES;
}
return NO;
}
- (NSArray<UITableViewRowAction *> *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewRowAction *cancelAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleNormal title:@"取消" handler:^(UITableViewRowAction * _Nonnull action, NSIndexPath * _Nonnull indexPath) {
NSLog(@"did select cancel button");
}];
UITableViewRowAction *deleteAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@"断货" handler:^(UITableViewRowAction * _Nonnull action, NSIndexPath * _Nonnull indexPath) {
NSLog(@"did select delete button");
}];
return @[deleteAction, cancelAction];
}
mark标记
// 配置简写: __marks
#pragma mark - life cycle
#pragma mark - event
#pragma mark - network
#pragma mark - delegate
#pragma mark - private
#pragma mark - public
#pragma mark - setter
#pragma mark - getter
注释
// 配置简写: __comments
/** <#Description#> */
打印函数位置
// 配置简写: __func
NSLog(@"%s",__FUNCTION__);




近期评论