iOS UITableView Scroll to bottom of section

前端 未结 5 539
鱼传尺愫
鱼传尺愫 2021-01-01 23:48

I am going to make a tableview with 2 sections inside it. I can add cells to every section programmatically and when i add, i scroll to the end of tableview using



        
5条回答
  •  再見小時候
    2021-01-02 00:29

    In Swift 3 it's been updated to:

    let indexPath = IndexPath(row: self.numberOfRowsInSection(0) - 1), section: 0)
    self.commentsTableView.scrollToRow(at: indexPath, at: .bottom, animated: false)
    

提交回复
热议问题