Refresh certain row of UITableView based on Int in Swift

前端 未结 11 533
别跟我提以往
别跟我提以往 2020-12-23 02:50

I am a beginning developer in Swift, and I am creating a basic app that includes a UITableView. I want to refresh a certain row of the table using:

self.tabl         


        
11条回答
  •  囚心锁ツ
    2020-12-23 03:33

    In Swift 3.0

    let rowNumber: Int = 2
    let sectionNumber: Int = 0
    
    let indexPath = IndexPath(item: rowNumber, section: sectionNumber)
    
    self.tableView.reloadRows(at: [indexPath], with: .automatic)
    

    byDefault, if you have only one section in TableView, then you can put section value 0.

提交回复
热议问题