Skip to content

Commit 1aa1b70

Browse files
committed
Fix contentEdgeInsets deprecation warnings
1 parent 64b6621 commit 1aa1b70

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

WooCommerce/Classes/ViewRelated/Products/ProductsViewController.swift

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,9 @@ final class ProductsViewController: UIViewController, GhostableViewController {
9797
button.setTitle(Localization.bulkEditingToolbarButtonTitle, for: .normal)
9898
button.addTarget(self, action: #selector(openBulkEditingOptions(sender:)), for: .touchUpInside)
9999
button.applyLinkButtonStyle()
100-
button.contentEdgeInsets = Constants.toolbarButtonInsets
100+
var configuration = UIButton.Configuration.plain()
101+
configuration.contentInsets = Constants.toolbarButtonInsets
102+
button.configuration = configuration
101103
button.isEnabled = false
102104
return button
103105
}()
@@ -519,7 +521,9 @@ private extension ProductsViewController {
519521

520522
[sortButton, filterButton].forEach {
521523
$0.applyLinkButtonStyle()
522-
$0.contentEdgeInsets = Constants.toolbarButtonInsets
524+
var configuration = UIButton.Configuration.plain()
525+
configuration.contentInsets = Constants.toolbarButtonInsets
526+
$0.configuration = configuration
523527
}
524528

525529
toolbar.backgroundColor = .systemColor(.secondarySystemGroupedBackground)
@@ -1187,7 +1191,7 @@ private extension ProductsViewController {
11871191
static let placeholderRowsPerSection = [3]
11881192
static let headerDefaultHeight = CGFloat(130)
11891193
static let headerContainerInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
1190-
static let toolbarButtonInsets = UIEdgeInsets(top: 12, left: 16, bottom: 12, right: 16)
1194+
static let toolbarButtonInsets = NSDirectionalEdgeInsets(top: 12, leading: 16, bottom: 12, trailing: 16)
11911195
}
11921196

11931197
enum Localization {

0 commit comments

Comments
 (0)