解决重写tableViewCell的初始化方法会导致cell的高度计算失效的BUG #266
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
在一个项目中,我重写一个tableViewCell类的-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier方法的时候,使用两个reuseIdentifier来给该cell类设置了两种不同的显示模式。结果cell高度计算全部失效。
经过分析,是因为SDAutoLayout实现高度计算的时候,内部注册cell默认统一使用的类的名字作为reuseIdentifier,然后导致我的类中使用reuseIdentifier来判断显示模式的方法全部没有调用。
因此,新增了几个接口,里面加入了reuseIdentifier判断, 如果使用自定义的reuseIdentifier在cell中进行了业务判断处理,使用新的接口就行了