Custom UITableViewCell in Swift Ios
func tableView(tableView: UITableView!, cellForRowAtIndexPath indexPath: NSIndexPath!) -> UITableViewCell!
{
var cell:SimpleTableCell! = tableView.dequeueReusableCellWithIdentifier(simpleTableIdentifier) as? SimpleTableCell
if (cell == nil)
{
let nib:Array = NSBundle.mainBundle().loadNibNamed("SimpleTableCell", owner: self, options: nil)
cell = nib[0] as? SimpleTableCell
}
cell.nameLabel.text = tableData[indexPath.row]
cell.thumbnailImageView.image = UIImage(named:thumbnails[indexPath.row])
cell.prepTimeLabel.text = prepTime[indexPath.row];
return cell;
}
{
var cell:SimpleTableCell! = tableView.dequeueReusableCellWithIdentifier(simpleTableIdentifier) as? SimpleTableCell
if (cell == nil)
{
let nib:Array = NSBundle.mainBundle().loadNibNamed("SimpleTableCell", owner: self, options: nil)
cell = nib[0] as? SimpleTableCell
}
cell.nameLabel.text = tableData[indexPath.row]
cell.thumbnailImageView.image = UIImage(named:thumbnails[indexPath.row])
cell.prepTimeLabel.text = prepTime[indexPath.row];
return cell;
}