https://github.com/1691665955/mztableview
高性能横向TableView,支持cell复用
https://github.com/1691665955/mztableview
horizontal ios swift tableview
Last synced: 3 months ago
JSON representation
高性能横向TableView,支持cell复用
- Host: GitHub
- URL: https://github.com/1691665955/mztableview
- Owner: 1691665955
- License: mit
- Created: 2021-12-21T06:18:27.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-05-03T11:41:49.000Z (about 2 years ago)
- Last Synced: 2025-02-13T05:33:12.980Z (3 months ago)
- Topics: horizontal, ios, swift, tableview
- Language: Swift
- Homepage:
- Size: 6.97 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MZHTableView
高性能横向TableView,支持cell复用![]()
以上图示例展示的效果,cell复用结果如下:
1000列的cell,cell复用池的cell总量为7![]()
#### Cocoapods 引入
```
pod 'MZHTableView', '~> 0.0.4'
```#### 使用
```
let tableView = MZTableView(frame: CGRect(x: 0, y: 100, width: SCREEN_WIDTH, height: 100))
// 代理
tableView.delegate = self
// 是否按页面宽度滚动
tableView.isPagingEnabled = true
// 注册class,实现cell复用功能
tableView.register(MZHTableViewCell.classForCoder(), forCellReuseIdentifier: "MZHTableViewCell")
self.view.addSubview(tableView)// 注册nib,实现cell复用功能
tableView.register(UINib(nibName: "MZHTableViewCell", bundle: nil), forCellReuseIdentifier: "MZHTableViewCell")// 通过已组册的identifier来获取cell
let cell = tableView.dequeueReusableCell(withIdentifier: "MZHTableViewCell") as! MZHTableViewCell// 刷新数据
// 是否滚动到最左边 默认为false
self.tableView.reloadData(true)
```