IOS-1442 trying to reproduce with Timer
authorDirk Zimmermann <dz@pep.security>
Thu, 17 Jan 2019 08:33:29 +0100
changeset 75408f510d2d414a
parent 7539 df2bc06b1496
child 7541 5d3d374bd3e0
IOS-1442 trying to reproduce with Timer
testProjects/TableViewReload/TableViewReload/ViewController.swift
     1.1 --- a/testProjects/TableViewReload/TableViewReload/ViewController.swift	Thu Jan 17 08:33:29 2019 +0100
     1.2 +++ b/testProjects/TableViewReload/TableViewReload/ViewController.swift	Thu Jan 17 08:33:29 2019 +0100
     1.3 @@ -16,7 +16,9 @@
     1.4  class ViewController: UITableViewController {
     1.5      override func viewDidLoad() {
     1.6          super.viewDidLoad()
     1.7 -        // Do any additional setup after loading the view, typically from a nib.
     1.8 +        Timer.scheduledTimer(withTimeInterval: 0.001, repeats: true) { timer in
     1.9 +            self.changeModel()
    1.10 +        }
    1.11      }
    1.12  
    1.13      func changeModel() {
    1.14 @@ -54,13 +56,6 @@
    1.15          if indexPath.section == 0 {
    1.16              let cell = UITableViewCell(style: .default, reuseIdentifier: cellId)
    1.17              cell.textLabel?.text = "\(indexPath.row)"
    1.18 -
    1.19 -            if indexPath.row == model.numRows - 1 {
    1.20 -                DispatchQueue.main.async {
    1.21 -                    self.changeModel()
    1.22 -                }
    1.23 -            }
    1.24 -
    1.25              return cell
    1.26          } else {
    1.27              let cell = UITableViewCell(style: .default, reuseIdentifier: cellId)