如何写静态tableView页面

学习了这篇文章 架构篇-谈谈如何写个人中心这类页面(静态tableView页面的编写)
给自己的学习做个记录。
根据自己的理解重写了一部分代码。


  • WynStaticCell.h
#import "WynBaseCell.h"

@class BaseCellDescriber;
@interface WynBaseStaticCell : WynBaseCell

@property (nonatomic, strong) BaseCellDescriber *describer;

@end


static NSString * const kUITableViewCell = @"WynBaseStaticCell";
static NSString * const kBaseCell = @"WynBaseStaticCell";

typedef void (^CustomCellBlock)(WynBaseStaticCell *cell, BaseCellDescriber *describer);
@interface BaseCellDescriber : NSObject
/**
 判断Cell 由代码还是xib创建 */
@property (nonatomic, assign) CellCreationType cellCreationType;
@property (nonatomic, copy) NSString *identifier;
/**
 UITableView default value */
@property (nonatomic, copy) NSString *textLabel_text;
@property (nonatomic, strong) UIFont *textLabel_font;
@property (nonatomic, strong) UIColor *textLabel_textColor;

@property (nonatomic, copy) NSString *detailTextLabel_text;
@property (nonatomic, strong) UIFont *detailTextLabel_font;
@property (nonatomic, strong) UIColor *detailTextLabel_textColor;

@property (nonatomic, assign) UITableViewCellAccessoryType accessoryType;

/**
 Block */
// (可选)在block中对cell赋值
@property (nonatomic, copy) CustomCellBlock customCellBlock;
@property (nonatomic, copy) void(^selectCellBlock)(WynBaseStaticCell *cell, BaseCellDescriber *describer);

- (CGFloat)cellHeight;
- (CustomCellBlock)defaultCustomCellBlock;

@end
  • WynStaticCell.m
#import "WynStaticCell.h"

static const CGFloat defaultCellHeight = 44.0;
@implementation WynBaseStaticCell


#pragma mark - Life cycle.
/*
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:sty
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值