RGListKit
RGListKit copied to clipboard
Overriding `cellForRowAtIndexPath` with RGListKit?
Yes we can override any method of any datasource or delegate. For that if you are overriding any implemented method like cellForRowAtIndexPath
then you have to create a new subclass of ListManager
like, e.g.
class CustomListManager: ListManager {}
extension CustomListManager {
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
//.. your custom logic
let cell = tableView.dequeueReusableCell(withIdentifier: "customCell", for: indexPath)
return cell
}
}
If you simply want to implement a new datasource or delegate then you can simply extend existing ListManager
like e.g.,
extension ListManager {
public func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
// your custom logic
}
}
Got it. Makes sense.
Awesome!