Question: I am using certain UI components within my custom cell class and I want to configure those in the willDisplayCell method. The original definition is 

```
public func tableView(tableView: UITableView, willDisplayCell cell: UITableViewCell, forRowAtIndexPath indexPath: NSIndexPath)

```

Now using `cell.myTextField.text = "customise"` 
gives out error that cell does not have any component as myTextField

to resolve this I will have to redefine the method to

```
public func tableView(tableView: UITableView, willDisplayCell cell: **myCustomCellClass**, forRowAtIndexPath indexPath: NSIndexPath)

```

Any leads on how to do this and subsequently how to redefine any present class methods in swift will be great. Thanks in advance.

Answer: 
You need to cast cell to your type inside function

```
public func tableView(tableView: UITableView, willDisplayCell cell: UITableViewCell, forRowAtIndexPath indexPath: NSIndexPath)
{
    if let myCell = cell as? **myCustomCellClass**
    {
        //perform your code to cell
    }
}

```
Сast cell of `UITableViewCell` type to your cell type 

```
func tableView(tableView: UITableView, willDisplayCell cell: UITableViewCell, forRowAtIndexPath indexPath: NSIndexPath) {

    if let aCell = cell as? YourCellClass {
        aCell.myTextField.text = "customise"
    }
}

```