Programmers learn & share
0 votes
245 views

Problem :

Facing following Swift issue
must register a nib or a class for the identifier or connect a prototype cell in a storyboard
by (6.9k points)   | 245 views

1 Answer

0 votes

Solution :

You can register a class easily for your UITableViewCell as following:

Swift 3+:

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

Swift 2.2:

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

Please make sure the same identifier "cell" is also copied at your storyboard's UITableViewCell.

The "self" is for getting the class and use the class name followed by .self.

by (36.1k points)  
2,204 questions
2,599 answers
59 comments
241 users