Created
December 16, 2014 20:39
-
-
Save iamjason/4461841615c0eeaecfe4 to your computer and use it in GitHub Desktop.
Generic UITableViewCell Implementation (swift)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class JGCell : UITableViewCell { | |
override init(style: UITableViewCellStyle, reuseIdentifier: String!) { | |
super.init(style: style, reuseIdentifier: reuseIdentifier) | |
setupViews() | |
} | |
required init(coder aDecoder: NSCoder) { | |
super.init(coder: aDecoder) | |
setupViews() | |
} | |
override func awakeFromNib() { | |
setupViews() | |
} | |
class var cellReuseIdentifier:String { | |
get { | |
return NSStringFromClass(self) | |
} | |
} | |
class func registerTableView(tableView:UITableView){ | |
tableView.registerClass(self, forCellReuseIdentifier: cellReuseIdentifier) | |
} | |
class func cellWithTableView(tableView:UITableView, indexPath:NSIndexPath) -> JGCell { | |
return tableView.dequeueReusableCellWithIdentifier(cellReuseIdentifier, forIndexPath: indexPath) as JGCell | |
} | |
func setupViews() { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment