Skip to content

Commit fb6615e

Browse files
committed
优化代码
1 parent df49cf5 commit fb6615e

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

Sources/UITableViewDynamicLayoutCacheHeight/UITableView+BMDynamicLayout.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ - (UIView *)_cellViewWithCellClass:(Class)clas {
9898
NSString *path = [bundle pathForResource:NSStringFromClass(clas) ofType:@"nib"];
9999
UITableViewCell *cell = nil;
100100
if (path.length > 0) {
101-
NSArray <UITableViewCell *> *arr = [bundle loadNibNamed:NSStringFromClass(clas) owner:nil options:nil];
101+
NSArray <UITableViewCell *> *arr = [[UINib nibWithNibName:NSStringFromClass(clas) bundle:bundle] instantiateWithOwner:nil options:nil];
102102
for (UITableViewCell *obj in arr) {
103103
if ([obj isMemberOfClass:clas]) {
104104
cell = obj;
@@ -183,7 +183,7 @@ - (UIView *)_headerFooterViewWithHeaderFooterViewClass:(Class)clas
183183
NSString *path = [bundle pathForResource:NSStringFromClass(clas) ofType:@"nib"];
184184
UIView *headerView = nil;
185185
if (path.length > 0) {
186-
NSArray <UITableViewHeaderFooterView *> *arr = [bundle loadNibNamed:NSStringFromClass(clas) owner:nil options:nil];
186+
NSArray <UITableViewHeaderFooterView *> *arr = [[UINib nibWithNibName:NSStringFromClass(clas) bundle:bundle] instantiateWithOwner:nil options:nil];
187187
for (UITableViewHeaderFooterView *obj in arr) {
188188
if ([obj isMemberOfClass:clas]) {
189189
headerView = obj;

Sources/UITableViewDynamicLayoutCacheHeight/UITableViewCell+BMDynamicLayout.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ + (instancetype)bm_tableViewCellFromNibWithTableView:(UITableView *)tableView {
4646
NSAssert(NO, @"你的 Cell 不是 IB 创建的");
4747
return nil;
4848
}
49-
50-
NSArray <UITableViewCell *> *arr = [bundle loadNibNamed:selfClassName owner:nil options:nil];
49+
50+
NSArray <UITableViewCell *> *arr = [[UINib nibWithNibName:selfClassName bundle:bundle] instantiateWithOwner:nil options:nil];
5151
for (UITableViewCell *obj in arr) {
5252
if ([obj isMemberOfClass:self.class]) {
5353
cell = obj;

Sources/UITableViewDynamicLayoutCacheHeight/UITableViewDynamicLayoutCacheHeight.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
// SOFTWARE.
2222

2323
////////////////
24-
/// v5.0.7
24+
/// v5.0.8
2525
////////////////
2626

2727
#ifndef UITableViewDynamicLayoutCacheHeight_h

Sources/UITableViewDynamicLayoutCacheHeight/UITableViewHeaderFooterView+BMDynamicLayout.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ + (instancetype)bm_tableViewHeaderFooterViewFromNibWithTableView:(UITableView *)
4646
NSAssert(NO, @"你的 UITableViewHeaderFooterView 不是 IB 创建的");
4747
return nil;
4848
}
49-
NSArray <UITableViewHeaderFooterView *> *arr = [bundle loadNibNamed:selfClassName owner:nil options:nil];
49+
NSArray <UITableViewHeaderFooterView *> *arr = [[UINib nibWithNibName:selfClassName bundle:bundle] instantiateWithOwner:nil options:nil];
5050
for (UITableViewHeaderFooterView *obj in arr) {
5151
if ([obj isMemberOfClass:self.class]) {
5252
headerFooterView = obj;

UITableViewDynamicLayoutCacheHeight.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'UITableViewDynamicLayoutCacheHeight'
3-
s.version = '5.0.7'
3+
s.version = '5.0.8'
44
s.summary = '🖖 Template auto layout cell for automatically UITableViewCell UITableViewHeaderFooterView calculating and cache height framework.'
55
s.homepage = 'https://github.com/liangdahong/UITableViewDynamicLayoutCacheHeight'
66
s.license = 'MIT'

0 commit comments

Comments
 (0)