LPRTableView icon indicating copy to clipboard operation
LPRTableView copied to clipboard

Not working with custom tableViewCell

Open Begoodi opened this issue 10 years ago • 1 comments

If the prototype cell is a custom class, it crashes.

I create my custom cell

< class MyCellClass: UITableViewCell {> < // code> < }>

I associate it with the prototype cell in the storyboard. And it crashes on this line : < let cell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath) as! MyCellClass>

=> Could not cast value of type 'UITableViewCell' (0x10bf7ec68) to 'ReorderTest. MyCellClass'

Is there a way to avoid that ?

Begoodi avatar Oct 16 '15 14:10 Begoodi

I know this question is old, but just in case. :)

Be sure to override registerClasses() as indicated in the readme.

override func registerClasses() {
  tableView.register(MyCellClass.self, forCellReuseIdentifier: "Cell")
}

cliftonlabrum avatar Jul 26 '18 02:07 cliftonlabrum