Why does UITableViewCell remain highlighted?

前端 未结 18 1264
余生分开走
余生分开走 2020-12-12 12:45

What would cause a table view cell to remain highlighted after being touched? I click the cell and can see it stays highlighted as a detail view is pushed. Once the detail

18条回答
  •  执笔经年
    2020-12-12 13:01

    Xcode 10, Swift 4

    I had this same issue and discovered I left an empty call to viewWillAppear at the bottom of my tableViewController. Once I removed the empty override function the row no longer stayed highlighted upon return to the tableView view.

    problem func

    override func viewWillAppear(_ animated: Bool) {
      // need to remove this function if not being used.
    }
    

    removing empty function solved my problem.

提交回复
热议问题