Skip to content

Instantly share code, notes, and snippets.

@joelmarquez90
Created January 2, 2018 14:44
Show Gist options
  • Save joelmarquez90/28c2e24dddb398b1336bf3d4dcc0e547 to your computer and use it in GitHub Desktop.
Save joelmarquez90/28c2e24dddb398b1336bf3d4dcc0e547 to your computer and use it in GitHub Desktop.
class BaseTableViewCell<Element: Codable>: UITableViewCell {
public var model: Element? {
didSet {
setupCell()
}
}
public func setupCell() {}
public class func nib() -> UINib {
return UINib(nibName: String(describing: self), bundle: nil)
}
public class func cellReuseIdentifier() -> String {
return "\(String(describing: self))ReuseIdentifier"
}
public class func cellHeight() -> CGFloat {
return 44
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment