Advertisement
Guest User

Untitled

a guest
Aug 25th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.69 KB | None | 0 0
  1. class EventTableCellTableViewCell: UITableViewCell {
  2.  
  3.  
  4. override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
  5. super.init(style: style, reuseIdentifier: reuseIdentifier) // the common code is executed in this super call
  6. // code unique to CellOne goes here
  7. print("INIT")
  8. self.contentView.backgroundColor = UIColor.blackColor()
  9. }
  10.  
  11. required init?(coder aDecoder: NSCoder) {
  12. super.init(coder: aDecoder)
  13. }
  14.  
  15. override func awakeFromNib() {
  16. super.awakeFromNib()
  17. // Initialization code
  18.  
  19. }
  20.  
  21. func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
  22. let cell = tableView.dequeueReusableCellWithIdentifier("eventCell", forIndexPath: indexPath) as! EventTableCellTableViewCell
  23. // cell.eventTitle.text = names[indexPath.row]
  24. // cell.eventDescription.text = descriptions[indexPath.row]
  25.  
  26. cell.contentView.clipsToBounds = false
  27.  
  28. //cell UIX
  29. let eventTitleLabel = UILabel()
  30. let dateLabel = UILabel()
  31. let authorLabel = UILabel()
  32. let locationLabel = UILabel()
  33.  
  34. let categoryView = UIImageView()
  35. //then I add everything
  36.  
  37. func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
  38.  
  39. //var cell = tableView.dequeueReusableCellWithIdentifier("eventCell", forIndexPath: indexPath) as! EventTableCellTableViewCell
  40.  
  41. var cell = tableView.dequeueReusableCellWithIdentifier("eventCell", forIndexPath: indexPath) as! UITableViewCell
  42. if (cell == nil) {
  43. cell = EventTableCellTableViewCell.init(style: .Default, reuseIdentifier: "eventCell")
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement