0 points

UItableView dequeueing with Swift magic!


dashboard

Fri Dec 27 2019 10:53:20 GMT+0000 (UTC)

Posted by @Catsndogs #ios #swift

import UIKit

extension UITableView {
    
    func dequeueReusableCell<T: UITableViewCell>() -> T {
        return dequeueReusableCell(withIdentifier: NSStringFromClass(T.self)) as! T
    }
}

//using: let cell: ExampleTableViewCell = tableView.dequeueReusableCell()
content_copy
https://gist.github.com/artemnovichkov/de5bd4daf64441c724a429d1a9b1e26e

>> Browse more code snippets

more_vert