Added the MenuItemCell class, created @ IBOutlets for the necessary buttons, when I initialize the TableView, I get a cell like this:

cell = tableActivityTypes.dequeueReusableCell(withIdentifier: "activitySubtype")! as! MenuItemCell 

And then I assign the necessary text to the button:

 cell.typeButton.titleLabel?.text = activityTypes[indexPath.row] 

But when you start the text of the buttons standard "Button". What am I doing wrong?

  • The problem is solved, the fault is my inattention - I mixed up the names of the buttons. @VandrJ thanks a lot! :) - Razorik

1 answer 1

We transfer the comment in reply.

To change the button text ( UIButton ) use the function setTitle(_:for:)