Skip to content

Instantly share code, notes, and snippets.

@3lvis
Created September 18, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 3lvis/0814f6326f05890d47ac to your computer and use it in GitHub Desktop.
Save 3lvis/0814f6326f05890d47ac to your computer and use it in GitHub Desktop.
Cell.swift
import UIKit
class SlotCell: UITableViewCell {
static let Identifier = "SlotCellIdentifier"
override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
self.contentView.backgroundColor = UIColor(hex: "28C787")
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
var slot: Slot? = nil {
didSet {
if let slot = slot {
self.textLabel?.text = "\(slot.startTime!.description) — \(slot.endTime!.description)"
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment