diff --git a/ZXTableView.podspec b/ZXTableView.podspec index 2c28f46..8b9801e 100644 --- a/ZXTableView.podspec +++ b/ZXTableView.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'ZXTableView' -s.version = '1.1.1' +s.version = '1.1.2' s.summary = '快速构建TableView' s.homepage = 'https://github.com/SmileZXLee/ZXTableView' s.license = 'MIT' diff --git a/ZXTableView/ZXTableView.h b/ZXTableView/ZXTableView.h index 7179f10..6e27ef5 100644 --- a/ZXTableView/ZXTableView.h +++ b/ZXTableView/ZXTableView.h @@ -85,6 +85,10 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, copy) void (^zx_willDisplayHeaderView)(NSInteger section,id headerView); ///headerView已经展示完毕,把id改成对应类名即可无需强制转换 @property (nonatomic, copy) void (^zx_didEndDisplayingHeaderView)(NSInteger section,id headerView); +///footerView将要展示,把id改成对应类名即可无需强制转换 +@property (nonatomic, copy) void (^zx_willDisplayFooterView)(NSInteger section,id footerView); +///footerView已经展示完毕,把id改成对应类名即可无需强制转换 +@property (nonatomic, copy) void (^zx_didEndDisplayingFooterView)(NSInteger section,id footerView); ///scrollView滚动事件 @property (nonatomic, copy) void (^zx_scrollViewDidScroll)(UIScrollView *scrollView); ///scrollView缩放事件 diff --git a/ZXTableView/ZXTableView.m b/ZXTableView/ZXTableView.m index 13130c3..8f188d5 100644 --- a/ZXTableView/ZXTableView.m +++ b/ZXTableView/ZXTableView.m @@ -327,13 +327,29 @@ -(void)tableView:(UITableView *)tableView willDisplayHeaderView:(UIView *)view f } - (void)tableView:(UITableView *)tableView didEndDisplayingHeaderView:(UIView *)view forSection:(NSInteger)section{ - if([self.zxDelegate respondsToSelector:@selector(tableView:willDisplayHeaderView:forSection:)]){ + if([self.zxDelegate respondsToSelector:@selector(tableView:didEndDisplayingHeaderView:forSection:)]){ [self.zxDelegate tableView:tableView didEndDisplayingHeaderView:view forSection:section]; }else{ !self.zx_didEndDisplayingHeaderView ? : self.zx_didEndDisplayingHeaderView(section,view); } } +- (void)tableView:(UITableView *)tableView willDisplayFooterView:(UIView *)view forSection:(NSInteger)section{ + if([self.zxDelegate respondsToSelector:@selector(tableView:willDisplayFooterView:forSection:)]){ + [self.zxDelegate tableView:tableView willDisplayFooterView:view forSection:section]; + }else{ + !self.zx_willDisplayFooterView ? : self.zx_willDisplayFooterView(section,view); + } +} + +- (void)tableView:(UITableView *)tableView didEndDisplayingFooterView:(UIView *)view forSection:(NSInteger)section{ + if([self.zxDelegate respondsToSelector:@selector(tableView:didEndDisplayingFooterView:forSection:)]){ + [self.zxDelegate tableView:tableView didEndDisplayingFooterView:view forSection:section]; + }else{ + !self.zx_didEndDisplayingFooterView ? : self.zx_didEndDisplayingFooterView(section,view); + } +} + #pragma mark - scrollView相关代理 -(void)scrollViewDidScroll:(UIScrollView *)scrollView{ if([self.zxDelegate respondsToSelector:@selector(scrollViewDidScroll:)]){ diff --git a/ZXTableViewDemo/ZXTableViewDemo/ZXTableView/ZXTableView.h b/ZXTableViewDemo/ZXTableViewDemo/ZXTableView/ZXTableView.h index 7179f10..6e27ef5 100644 --- a/ZXTableViewDemo/ZXTableViewDemo/ZXTableView/ZXTableView.h +++ b/ZXTableViewDemo/ZXTableViewDemo/ZXTableView/ZXTableView.h @@ -85,6 +85,10 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, copy) void (^zx_willDisplayHeaderView)(NSInteger section,id headerView); ///headerView已经展示完毕,把id改成对应类名即可无需强制转换 @property (nonatomic, copy) void (^zx_didEndDisplayingHeaderView)(NSInteger section,id headerView); +///footerView将要展示,把id改成对应类名即可无需强制转换 +@property (nonatomic, copy) void (^zx_willDisplayFooterView)(NSInteger section,id footerView); +///footerView已经展示完毕,把id改成对应类名即可无需强制转换 +@property (nonatomic, copy) void (^zx_didEndDisplayingFooterView)(NSInteger section,id footerView); ///scrollView滚动事件 @property (nonatomic, copy) void (^zx_scrollViewDidScroll)(UIScrollView *scrollView); ///scrollView缩放事件 diff --git a/ZXTableViewDemo/ZXTableViewDemo/ZXTableView/ZXTableView.m b/ZXTableViewDemo/ZXTableViewDemo/ZXTableView/ZXTableView.m index 13130c3..8f188d5 100644 --- a/ZXTableViewDemo/ZXTableViewDemo/ZXTableView/ZXTableView.m +++ b/ZXTableViewDemo/ZXTableViewDemo/ZXTableView/ZXTableView.m @@ -327,13 +327,29 @@ -(void)tableView:(UITableView *)tableView willDisplayHeaderView:(UIView *)view f } - (void)tableView:(UITableView *)tableView didEndDisplayingHeaderView:(UIView *)view forSection:(NSInteger)section{ - if([self.zxDelegate respondsToSelector:@selector(tableView:willDisplayHeaderView:forSection:)]){ + if([self.zxDelegate respondsToSelector:@selector(tableView:didEndDisplayingHeaderView:forSection:)]){ [self.zxDelegate tableView:tableView didEndDisplayingHeaderView:view forSection:section]; }else{ !self.zx_didEndDisplayingHeaderView ? : self.zx_didEndDisplayingHeaderView(section,view); } } +- (void)tableView:(UITableView *)tableView willDisplayFooterView:(UIView *)view forSection:(NSInteger)section{ + if([self.zxDelegate respondsToSelector:@selector(tableView:willDisplayFooterView:forSection:)]){ + [self.zxDelegate tableView:tableView willDisplayFooterView:view forSection:section]; + }else{ + !self.zx_willDisplayFooterView ? : self.zx_willDisplayFooterView(section,view); + } +} + +- (void)tableView:(UITableView *)tableView didEndDisplayingFooterView:(UIView *)view forSection:(NSInteger)section{ + if([self.zxDelegate respondsToSelector:@selector(tableView:didEndDisplayingFooterView:forSection:)]){ + [self.zxDelegate tableView:tableView didEndDisplayingFooterView:view forSection:section]; + }else{ + !self.zx_didEndDisplayingFooterView ? : self.zx_didEndDisplayingFooterView(section,view); + } +} + #pragma mark - scrollView相关代理 -(void)scrollViewDidScroll:(UIScrollView *)scrollView{ if([self.zxDelegate respondsToSelector:@selector(scrollViewDidScroll:)]){