Warning : <<'contentEdgeInsets' was deprecated in iOS 15.0: This property is ignored when using UIButtonConfiguration>>
I don't use SwiftUI so what is the replacement for contentEdgeInsets? None of the UIButtonConfiguration or UIButton.Configuration.filled() exist.
I need to be able to change the inset dynamically.
Problem
//Warning : 'contentEdgeInsets' was deprecated in iOS 15.0:
// This property is ignored when using UIButtonConfiguration
/*uiButton.contentEdgeInsets = UIEdgeInsets(top: 8.0, left: 8.0, bottom: 8.0,right: 8.0 )
Solution
uiButton.configuration!.contentInsets = NSDirectionalEdgeInsets(top: 8.0, leading: 8.0, bottom: 8.0, trailing: 8.0)
Apple has finally given access to "uiButton.configuration!.contentInsets" in their latest Xcode update. It now woks on iOS and macCatalyst.