how to change the button title on click inside a tableview cell in swift 3

前端 未结 3 595
野趣味
野趣味 2021-01-01 06:28

I got a tableview cell inside that i have image view , label and a ui button , i need to change the button title text and background colour on click . But when i try to do

3条回答
  •  借酒劲吻你
    2021-01-01 06:46

    Set the title and the background color properties of the button in tableview's didSelectRowAtIndexPath delegate

    cell.button.setTitle("title", for: .normal)
    cell.button.backgroundColor = .darkGray
    

提交回复
热议问题