1

How can I increase the size of text at my UIContextualAction? Here is how I set it up.

func tableView(_ tableView: UITableView, leadingSwipeActionsConfigurationForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration? {
    let action = UIContextualAction(style: .normal, title:  "\u{02606}", handler: { (ac:UIContextualAction, view:UIView, success:(Bool) -> Void) in
        success(true)
    })
    action.backgroundColor = .blue
    return UISwipeActionsConfiguration(actions: [action]) 
}
Yury Imashev
  • 2,068
  • 1
  • 18
  • 32
Ginso
  • 459
  • 17
  • 33
  • I'm sorry but you can't change the font size of an UIContextualAction titleLabel – Leonardo Di Nardo Sep 24 '18 at 20:02
  • You could mess around with `UIAppearance`, but this will always be an unreliable hack, see https://stackoverflow.com/questions/46398910/ios11-uicontextualaction-place-the-image-color-text – Andreas Oetjen Sep 26 '18 at 07:57
  • This solution works https://stackoverflow.com/questions/56588715/set-custom-font-for-uitableview-swipe-action-uicontextualaction – Elto Jun 04 '20 at 14:39

0 Answers0