Skip to content

Commit

Permalink
优化代码
Browse files Browse the repository at this point in the history
  • Loading branch information
liangdahong committed Jun 10, 2020
1 parent df49cf5 commit fb6615e
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ - (UIView *)_cellViewWithCellClass:(Class)clas {
NSString *path = [bundle pathForResource:NSStringFromClass(clas) ofType:@"nib"];
UITableViewCell *cell = nil;
if (path.length > 0) {
NSArray <UITableViewCell *> *arr = [bundle loadNibNamed:NSStringFromClass(clas) owner:nil options:nil];
NSArray <UITableViewCell *> *arr = [[UINib nibWithNibName:NSStringFromClass(clas) bundle:bundle] instantiateWithOwner:nil options:nil];
for (UITableViewCell *obj in arr) {
if ([obj isMemberOfClass:clas]) {
cell = obj;
Expand Down Expand Up @@ -183,7 +183,7 @@ - (UIView *)_headerFooterViewWithHeaderFooterViewClass:(Class)clas
NSString *path = [bundle pathForResource:NSStringFromClass(clas) ofType:@"nib"];
UIView *headerView = nil;
if (path.length > 0) {
NSArray <UITableViewHeaderFooterView *> *arr = [bundle loadNibNamed:NSStringFromClass(clas) owner:nil options:nil];
NSArray <UITableViewHeaderFooterView *> *arr = [[UINib nibWithNibName:NSStringFromClass(clas) bundle:bundle] instantiateWithOwner:nil options:nil];
for (UITableViewHeaderFooterView *obj in arr) {
if ([obj isMemberOfClass:clas]) {
headerView = obj;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ + (instancetype)bm_tableViewCellFromNibWithTableView:(UITableView *)tableView {
NSAssert(NO, @"你的 Cell 不是 IB 创建的");
return nil;
}
NSArray <UITableViewCell *> *arr = [bundle loadNibNamed:selfClassName owner:nil options:nil];

NSArray <UITableViewCell *> *arr = [[UINib nibWithNibName:selfClassName bundle:bundle] instantiateWithOwner:nil options:nil];
for (UITableViewCell *obj in arr) {
if ([obj isMemberOfClass:self.class]) {
cell = obj;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
// SOFTWARE.

////////////////
/// v5.0.7
/// v5.0.8
////////////////

#ifndef UITableViewDynamicLayoutCacheHeight_h
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ + (instancetype)bm_tableViewHeaderFooterViewFromNibWithTableView:(UITableView *)
NSAssert(NO, @"你的 UITableViewHeaderFooterView 不是 IB 创建的");
return nil;
}
NSArray <UITableViewHeaderFooterView *> *arr = [bundle loadNibNamed:selfClassName owner:nil options:nil];
NSArray <UITableViewHeaderFooterView *> *arr = [[UINib nibWithNibName:selfClassName bundle:bundle] instantiateWithOwner:nil options:nil];
for (UITableViewHeaderFooterView *obj in arr) {
if ([obj isMemberOfClass:self.class]) {
headerFooterView = obj;
Expand Down
2 changes: 1 addition & 1 deletion UITableViewDynamicLayoutCacheHeight.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'UITableViewDynamicLayoutCacheHeight'
s.version = '5.0.7'
s.version = '5.0.8'
s.summary = '🖖 Template auto layout cell for automatically UITableViewCell UITableViewHeaderFooterView calculating and cache height framework.'
s.homepage = 'https://github.com/liangdahong/UITableViewDynamicLayoutCacheHeight'
s.license = 'MIT'
Expand Down

0 comments on commit fb6615e

Please sign in to comment.