Upvote:2

Aprove answer
var isExpanded: Bool = false

func cellConfigure(isExpanded : Bool, info: Info) {

    viewMoreBtn.titleLabel?.text = isExpanded ? "View less":"View more"
    cellHeight.constant = isExpanded ? 40 : 120

}

@IBAction func viewMoreBtnAction(_ sender: Any) {
    delegate?.viewMoreTapped(cell: self) // this is custom protocol
}

Credit Goes to: stackoverflow.com

Related question with same questions but different answers