Problem

When we setup a static tableviewcell in tableviewcontroller, you have set the layout of the views in the static tableviewcell, but you find that no views are shown up in the simulator. Why? they should be there!

Environment

  • MacOS 10.14
  • XCode 11.3
  • Swift 5

Solution

You should open your tableviewController, and find these functions ,then comment them:

//    override func numberOfSections(in tableView: UITableView) -> Int {
//        // #warning Incomplete implementation, return the number of sections
//        return 0
//    }
//
//    override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
//        // #warning Incomplete implementation, return the number of rows
//        return 0
//    }

Ok, everything is done.