My TapCell1.swift
This is Custom UITableViewCell View
import UIKit
class TapCell1: UITableViewCell
{
@IBOutlet var
I have now been able to get Custom UITableViewCell to work.
Runs on Xcode 6 beta 5
iOS is 7.1
Doing it this way, you do not need to register a class / nib etc.
This is my custom cell.
import UIKit class TestCell: UITableViewCell { @IBOutlet var titleImageView: UIImageView! @IBOutlet var titleLabel: UILabel! override init(style: UITableViewCellStyle, reuseIdentifier: String!) { super.init(style: style, reuseIdentifier: reuseIdentifier) } override func awakeFromNib() { super.awakeFromNib() // Initialization code } required init(coder aDecoder: NSCoder) { super.init(coder: aDecoder) } }
In your view, or where ever you extend "UITableViewDataSource". Make sure "cell2" is the same as the "Identifier" that you gave it via the storyboard.
func tableView(tableView: UITableView!, cellForRowAtIndexPath indexPath: NSIndexPath!) -> UITableViewCell! { var cell:TestCell = tableView.dequeueReusableCellWithIdentifier("cell2", forIndexPath: indexPath) as TestCell // Example of using the custom elements. cell.titleLabel.text = self.items[indexPath.row] var topImage = UIImage(named: "fv.png") cell.titleImageView.image = topImage return cell }
uitableviewcell