Expand and Collapse tableview cells

前端 未结 4 1189
面向向阳花
面向向阳花 2020-12-01 10:43

I\'m able to expand and collapse cells but i wanna call functions (expand and collapse) inside UITableViewCell to change button title.

import UIKit

clas         


        
4条回答
  •  北荒
    北荒 (楼主)
    2020-12-01 10:59

    In MyTicketsTableViewController class, inside cellForRowAtIndexPath datasource method add target for the button.

    cell.expandButton.addTarget(self, action: "expandorcollapsed:", forControlEvents: UIControlEvents.TouchUpInside)
    

提交回复
热议问题