2 // WLTableViewCell.swift
5 // Created by Pawel Dabrowski on 30/05/2018.
6 // Copyright © 2018 Fundacja Nowoczesna Polska. All rights reserved.
11 class WLTableViewCell: UITableViewCell {
13 override func awakeFromNib() {
15 selectionStyle = .none
18 override func setSelected(_ selected: Bool, animated: Bool) {
19 super.setSelected(selected, animated: animated)
21 // Configure the view for the selected state
24 static var fullNameIdentifier: String {
25 var fullName: String = NSStringFromClass(self)
26 let range = fullName.range(of: ".", options: .backwards)
27 if let range = range {
28 fullName = fullName.substring(from: range.upperBound)
33 static var reuseIdentifier: String {
34 return fullNameIdentifier
37 class func instance<T>(type: T.Type) -> T{
38 let cell = Bundle.main.loadNibNamed(fullNameIdentifier, owner: nil, options: nil)!.first as! T
42 static var nib: UINib? {
43 if((Bundle.main.path(forResource: fullNameIdentifier, ofType: "nib")) != nil)
45 return UINib(nibName: String(fullNameIdentifier), bundle: nil)
50 func getHeight() -> CGFloat {
51 return UITableViewAutomaticDimension