iosswiftuitableviewregisterclass

UITableView - registerClass with Swift


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 manually typed) but it is still in the headers...

Code Completion

UITableView headers


Solution

  • It works for me perfectly.

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

    Exactly as I have it above.