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...
Go to the XIB file and make sure the cell is selected to set some properties in the Attributes Inspector. First add an identifier "HabitCell" for cell reuse. Next select an Accessory, choose the option "Disclosure indicator", this is the arrow that you see in the right side of the cell.
A view that presents data using rows in a single column. iOS 2.0+ iPadOS 2.0+ Mac Catalyst 13.1+ tvOS 9.0+
If you want to use register() with a Swift class, you provide a table view cell class as its first parameter. This is useful if your cell is defined entirely in code. As an example, this uses the default UITableViewCell class: tableView. register(UITableViewCell.
yes it is possible, I added the UITableVIew within the UITableView cell .. :) no need to add tableview cell in xib file - just subclass the UITableviewCell and use the code below, a cell will be created programatically.
It works for me perfectly.
self.tableView.register(UITableViewCell.self, forCellReuseIdentifier: "cell")
Exactly as I have it above.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With