How to animate UITableViewCell using Swift?
<p>I have a UITableView and inside the  tableViewCell I have a UICollectionView.</p>

<p>My requirement is while tapping on a button of first tableView cell I have to animate  second tableViewCell.</p>

<p>Below is my code :-    </p>

<pre><code> //Cell For Row at indexPath
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell {

    if (0 == indexPath.section) {
        let cell = tableView.dequeueReusableCell(withIdentifier: "FirstRowCell") as! FirstRowCell
        cell.btnReview.addTarget(self, action: #selector(GotoReview), for: UIControlEvents.touchUpInside)
        cell.btnMyProduct.addTarget(self, action: #selector(AnimateCollectionView), for: UIControlEvents.touchUpInside)
        //cell.

        return cell
    } else if ( 1 == indexPath.section) {
        let identifier = "TableCollectionCell"
        var tableCollectionCell = tableView.dequeueReusableCell(withIdentifier: identifier) as? TableCollectionCell

        if(tableCollectionCell == nil) {
            let nib:Array = Bundle.main.loadNibNamed("TableCollectionCell", owner: self, options: nil)!
            tableCollectionCell = nib[0] as? TableCollectionCell
            tableCollectionCell?.delegate = self
        }

        return tableCollectionCell!
    } else {
        let identifier = "BrandImagesTableCell"
        var brandImagesTableCell = tableView.dequeueReusableCell(withIdentifier: identifier)

        if(brandImagesTableCell == nil) {
            let nib:Array = Bundle.main.loadNibNamed("BrandImagesTableCell", owner: self, options: nil)!
            brandImagesTableCell = nib[0] as? BrandImagesTableCell
          }

        //brandImagesTableCell.
        return brandImagesTableCell!
    }
} 
</code></pre>

<p>In my code you can see:   </p>

<pre><code>        if (0 == indexPath.section)  
</code></pre>

<p>In that I have a button target  (<code>#selector(AnimateCollectionView)</code>).<br>
I want to animate  tableCollectionCell which is at  (<code>1 == indexPath.section</code>).</p>

<p>See my  <code>AnimateCollectionView</code> method :-   </p>

<pre><code>func AnimateCollectionView() {
    let identifier = "TableCollectionCell"
    var tableCollectionCell = tableView.dequeueReusableCell(withIdentifier: identifier) as? TableCollectionCell

    if(tableCollectionCell == nil) {
        let nib:Array = Bundle.main.loadNibNamed("TableCollectionCell", owner: self, options: nil)!
        tableCollectionCell = nib[0] as? TableCollectionCell
        tableCollectionCell?.delegate = self
    }

    tableCollectionCell?.alpha = 0

    UIView.animate(withDuration: 1.50, animations: {
        //self.view.layoutIfNeeded()
        tableCollectionCell?.alpha = 1
    })
}  
</code></pre>