‘imageEdgeInsets’ was deprecated in iOS 15.0

iOS 15 Apple introduced 3 new options to control padding and insets.

  1. .titlePadding : Padding between the title and subtitle labels.
  2. .imagePadding : Padding between the button’s image and text.
  3. .contentInsets: Padding from the button’s content area to its bounds.

Using the above option you can manage and set your button style according.

enter image description here

You can check this article for more. Source and Image

So your code should be like this

var configuration = UIButton.Configuration.filled()
configuration.title = "Title"
configuration.image = UIImage(systemName: "swift")
configuration.titlePadding = 10
configuration.imagePadding = 10
configuration.contentInsets = NSDirectionalEdgeInsets(top: 10, leading: 10, bottom: 10, trailing: 10)

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)