Start tableview when starting the view from below.
I have a one-dimensional array for the header and a two-dimensional array for the cellen.
Is it possible to start the tableview when calling viewDidLoad () from below? So you have to scroll up.
many thanks
Code for my Header:
override func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
let headerView = Bundle.main.loadNibNamed("TableViewCell1", owner: self, options: nil)?.first as! TableViewCell1
headerView.date.text = aHeaderDate[section]
headerView.backgroundColor = UIColor.white
return headerView
}
Code for my Cell:
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell2 = Bundle.main.loadNibNamed("TableViewCell2", owner: self, options: nil)?.last as! TableViewCell2
let sectionTime = dimArrayTime[indexPath.section][indexPath.row]
cell2.time.text = sectionTime
return cell2
}
That's how it should be: