Skip to content

Commit 3496af6

Browse files
committed
Move title string from view controller to view.
1 parent 0689f87 commit 3496af6

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

WooCommerce/Classes/ViewRelated/Dashboard/Stats v4/StoreStatsAndTopPerformersPeriodViewController.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,7 @@ final class StoreStatsAndTopPerformersPeriodViewController: UIViewController {
7575
return stackView
7676
}()
7777

78-
private lazy var topPerformersHeaderView =
79-
TopPerformersSectionHeaderView(title: NSLocalizedString("Top Performers",
80-
comment: "Header label for Top Performers section of My Store tab."))
78+
private lazy var topPerformersHeaderView = TopPerformersSectionHeaderView()
8179

8280
// MARK: Child View Controllers
8381

WooCommerce/Classes/ViewRelated/Dashboard/Stats v4/TopPerformersSectionHeaderView.swift

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ import Experiments
55
/// This contains a vertical stack view of a title label and a two-column view of labels for top performers data (products and items sold).
66
///
77
final class TopPerformersSectionHeaderView: UIView {
8-
init(title: String) {
8+
init() {
99
super.init(frame: .zero)
1010
translatesAutoresizingMaskIntoConstraints = false
1111

1212
configureView()
13-
configureStackView(title: title)
13+
configureStackView()
1414
}
1515

1616
required init?(coder aDecoder: NSCoder) {
@@ -23,8 +23,8 @@ private extension TopPerformersSectionHeaderView {
2323
backgroundColor = Constants.backgroundColor
2424
}
2525

26-
func configureStackView(title: String) {
27-
let titleView = createTitleLabelContainerView(title: title)
26+
func configureStackView() {
27+
let titleView = createTitleLabelContainerView(title: Localization.title)
2828
let twoColumnStackView: UIStackView = {
2929
let leftLabelContainer = createColumnLabelContainerView(labelText: Localization.leftColumn, columnPosition: .left)
3030
let rightLabelContainer = createColumnLabelContainerView(labelText: Localization.rightColumn, columnPosition: .right)
@@ -127,6 +127,8 @@ private extension TopPerformersSectionHeaderView {
127127
//
128128
private extension TopPerformersSectionHeaderView {
129129
enum Localization {
130+
static let title = NSLocalizedString("Top Performers",
131+
comment: "Header label for Top Performers section of My Store tab.")
130132
static let leftColumn = NSLocalizedString("Products", comment: "Description for Top Performers left column header")
131133
static let rightColumn = NSLocalizedString("Items Sold", comment: "Description for Top Performers right column header")
132134
}

0 commit comments

Comments
 (0)