Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class EventTableCellTableViewCell: UITableViewCell {
- override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
- super.init(style: style, reuseIdentifier: reuseIdentifier) // the common code is executed in this super call
- // code unique to CellOne goes here
- print("INIT")
- self.contentView.backgroundColor = UIColor.blackColor()
- }
- required init?(coder aDecoder: NSCoder) {
- super.init(coder: aDecoder)
- }
- override func awakeFromNib() {
- super.awakeFromNib()
- // Initialization code
- }
- func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
- let cell = tableView.dequeueReusableCellWithIdentifier("eventCell", forIndexPath: indexPath) as! EventTableCellTableViewCell
- // cell.eventTitle.text = names[indexPath.row]
- // cell.eventDescription.text = descriptions[indexPath.row]
- cell.contentView.clipsToBounds = false
- //cell UIX
- let eventTitleLabel = UILabel()
- let dateLabel = UILabel()
- let authorLabel = UILabel()
- let locationLabel = UILabel()
- let categoryView = UIImageView()
- //then I add everything
- func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
- //var cell = tableView.dequeueReusableCellWithIdentifier("eventCell", forIndexPath: indexPath) as! EventTableCellTableViewCell
- var cell = tableView.dequeueReusableCellWithIdentifier("eventCell", forIndexPath: indexPath) as! UITableViewCell
- if (cell == nil) {
- cell = EventTableCellTableViewCell.init(style: .Default, reuseIdentifier: "eventCell")
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement