Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working with custom tableViewCell #14

Open
Begoodi opened this issue Oct 16, 2015 · 1 comment
Open

Not working with custom tableViewCell #14

Begoodi opened this issue Oct 16, 2015 · 1 comment

Comments

@Begoodi
Copy link

Begoodi commented Oct 16, 2015

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 ?

@cliftonlabrum
Copy link

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")
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants