Skip to content

Commit 89fefde

Browse files
committed
expand traits registration for refund and shipping views
1 parent 2469763 commit 89fefde

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

WooCommerce/Classes/ViewRelated/Orders/Order Details/Issue Refunds/Cells/RefundShippingDetailsTableViewCell.swift

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,15 @@ final class RefundShippingDetailsTableViewCell: UITableViewCell {
5252
super.awakeFromNib()
5353
applyCellStyles()
5454
applyAccessibilityChanges()
55-
56-
registerForTraitChanges([UITraitPreferredContentSizeCategory.self]) { [weak self] (_: RefundShippingDetailsTableViewCell, _: UITraitCollection) in
57-
self?.applyAccessibilityChanges()
55+
56+
let traits: [UITrait] = [
57+
UITraitPreferredContentSizeCategory.self,
58+
UITraitUserInterfaceIdiom.self,
59+
UITraitVerticalSizeClass.self
60+
]
61+
62+
registerForTraitChanges(traits) { (self: Self, _: UITraitCollection) in
63+
self.applyAccessibilityChanges()
5864
}
5965
}
6066

WooCommerce/Classes/ViewRelated/Orders/Order Details/Issue Refunds/IssueRefundViewController.swift

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,15 @@ final class IssueRefundViewController: UIViewController {
4848
viewModel.fetch()
4949
updateWithViewModelContent()
5050

51-
registerForTraitChanges([UITraitPreferredContentSizeCategory.self]) { [weak self] (_: IssueRefundViewController, _: UITraitCollection) in
52-
self?.configureHeaderStackView()
53-
self?.tableView.updateHeaderHeight()
51+
let traits: [UITrait] = [
52+
UITraitPreferredContentSizeCategory.self,
53+
UITraitUserInterfaceIdiom.self,
54+
UITraitVerticalSizeClass.self
55+
]
56+
57+
registerForTraitChanges(traits) {(self: Self, _: UITraitCollection) in
58+
self.configureHeaderStackView()
59+
self.tableView.updateHeaderHeight()
5460
}
5561
}
5662

0 commit comments

Comments
 (0)