CocoaPods trunk is moving to be read-only. Read more on the blog, there are 8 months to go.
| TestsTested | ✗ |
| LangLanguage | Obj-CObjective C |
| License | MIT |
| ReleasedLast Release | Mar 2017 |
Maintained by kelei.
受 CYLTableViewPlaceHolder 启发,将更新数据的方法尽可能的封装(不只是reload),使得不用修改现有代码,及可非常容易的实现UITableView和UICollectionView的“无数据”提示,零成本。
CYLTableViewPlaceHolder优点:reload
insertSections:、deleteSections:、insertRowsAtIndexPaths:等等Auto Layout设置placeholderView位置,更准确,且支持横竖屏切换placeholderView逻辑([self.tableView kl_placeholderViewBlock:nil];)UICollectionView
CocoaPod
pod 'KLTableViewAndCollectionViewPlaceholder'
Objective-C
[self.tableView kl_placeholderViewBlock:^UIView * _Nonnull(UITableView * _Nonnull tableView) {
// 这里做空数据操作,例如弹出提示
// 禁止 TableView 滚动
tableView.scrollEnabled = NO;
// 返回无数据提示视图
return placeholderView;
} backToNormalBlock:^(UITableView * _Nonnull tableView) {
// 这里做恢复操作
// 恢复 TableView 滚动
tableView.scrollEnabled = YES;
}];Swift
tableView.kl_placeholderViewBlock({ (tableView) -> UIView in
tableView.isScrollEnabled = false
return placeholderView
}, backToNormalBlock: { (tableView) in
tableView.isScrollEnabled = true
})![]() |
![]() |
|---|
Centipede is released under the MIT license. See LICENSE for details.