UITableView - registerClass with Swift

前端 未结 9 1973
一向
一向 2021-02-06 20:17

Is anyone else having an issue using the tableView.registerClass method with Swift?

It no longer comes in code completion for me (nor can I use it if manual

9条回答
  •  时光说笑
    2021-02-06 21:00

    Swift has once again renamed it to

    tableView.register(UITableViewCell.self, forCellReuseIdentifier:"DefaultCell")

    Really don't understand why they bothered so much about this particular naming

提交回复
热议问题