Catalin Cristian Catalin Cristian - 7 months ago 208
iOS Question

Swift: Set UITableViewRowAction button size

I have a short question: how can I programmatically set the UITableViewRowAction button size? Is there a specific native method or I have to make custom buttons for that? I have been struggling with this for many hours and search for an answer all over the internet.



Unfortunately, you can't. The button is the height of the containing cell and the width of the string, plus 15 points of padding on the left and right. The only customizable properties of UITableViewRowAction are

  1. backgroundColor
  2. style
  3. title

You can fake a wider button by adding whitespace characters to the title string.