我想知道tableview是否有任何内置函数来添加无限滚动/分页.
现在我的VC看起来像这样:
var data: JSON! = []
override func viewDidLoad() {
super.viewDidLoad()
//Init start height of cell
self.tableView.estimatedRowHeight = 122
self.tableView.rowHeight = UITableViewAutomaticDimension
self.tableView.delegate = self
self.tableView.dataSource = self
savedLoader.startAnimation()
//Load first page
loadSaved(1)
}
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return data.count
}
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("aCell") as! SavedTableViewCell
let info = data[indexPath.row]
cell.configureWithData(info)
return cell
}
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
performSegueWithIdentifier("WebSegue", sender: indexPath) …Run Code Online (Sandbox Code Playgroud) 我需要创建一个支持双向无限滚动的动态UITableView.我需要把它带到它不循环的地方,而不是只是继续朝这个方向发展,因为它将处理日期.
tableView将在另外两个UITableViews中的UIViewController中; 其中一个是静态的,另一个是动态的(默认方式).这也提出了如何处理我的一些数据源方法的问题.也就是说,tableView:NumberOfRowsInSection因为我拥有的数据点的数量将在算法上生成,因此可能是无限的(如:在显示所有数据之前,数据没有定义的数量)
我想在uitableview中创建加载更多数据,比如在当时显示活动指示器并再次加载更多数据.我在ios开发中使用asihttp请求进行Web服务.所以请帮帮我......