Skip to content

Commit b9bd8f4

Browse files
committed
Update BottomSheetListSelectorSectionHeaderView to include a title & a subtitle
1 parent f624c72 commit b9bd8f4

File tree

2 files changed

+28
-11
lines changed

2 files changed

+28
-11
lines changed

WooCommerce/Classes/ViewRelated/BottomSheet/ListSelector/BottomSheetListSelectorSectionHeaderView.swift

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,20 @@ import UIKit
33
/// Renders a section header for the bottom sheet list selector with a main title label.
44
///
55
final class BottomSheetListSelectorSectionHeaderView: UITableViewHeaderFooterView {
6-
@IBOutlet private weak var label: UILabel!
6+
@IBOutlet private weak var title: UILabel!
7+
@IBOutlet private weak var subtitle: UILabel!
78

89
override func awakeFromNib() {
910
super.awakeFromNib()
1011

1112
configureMainView()
12-
configureLabel()
13+
configureTitle()
14+
configureSubtitle()
1315
}
1416

15-
func configure(text: String?) {
16-
label.text = text
17+
func configure(title: String?, subtitle: String?) {
18+
self.title.text = title
19+
self.subtitle.text = subtitle
1720
}
1821
}
1922

@@ -22,8 +25,13 @@ private extension BottomSheetListSelectorSectionHeaderView {
2225
contentView.backgroundColor = .listForeground
2326
}
2427

25-
func configureLabel() {
26-
label.applySubheadlineStyle()
27-
label.textColor = .systemColor(.secondaryLabel)
28+
func configureTitle() {
29+
title.applyTitleStyle()
30+
title.textColor = .systemColor(.label)
31+
}
32+
33+
func configureSubtitle() {
34+
subtitle.applySubheadlineStyle()
35+
subtitle.textColor = .systemColor(.secondaryLabel)
2836
}
2937
}

WooCommerce/Classes/ViewRelated/BottomSheet/ListSelector/BottomSheetListSelectorSectionHeaderView.xib

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="20037" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="21225" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
33
<device id="retina6_1" orientation="portrait" appearance="light"/>
44
<dependencies>
55
<deployment identifier="iOS"/>
6-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="20020"/>
6+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21207"/>
77
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
88
<capability name="System colors in document resources" minToolsVersion="11.0"/>
99
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
@@ -15,8 +15,14 @@
1515
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
1616
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
1717
<subviews>
18+
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="yNN-dG-kuA">
19+
<rect key="frame" x="16" y="23" width="42" height="21"/>
20+
<fontDescription key="fontDescription" type="system" pointSize="17"/>
21+
<nil key="textColor"/>
22+
<nil key="highlightedColor"/>
23+
</label>
1824
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="MUy-0K-UzK">
19-
<rect key="frame" x="16" y="56" width="382" height="794"/>
25+
<rect key="frame" x="16" y="60" width="382" height="790"/>
2026
<fontDescription key="fontDescription" type="system" pointSize="17"/>
2127
<nil key="textColor"/>
2228
<nil key="highlightedColor"/>
@@ -28,11 +34,14 @@
2834
<constraint firstItem="MUy-0K-UzK" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" constant="16" id="GnY-De-657"/>
2935
<constraint firstItem="vUN-kp-3ea" firstAttribute="trailing" secondItem="MUy-0K-UzK" secondAttribute="trailing" priority="999" constant="16" id="MnQ-Ob-Wp4"/>
3036
<constraint firstItem="vUN-kp-3ea" firstAttribute="bottom" secondItem="MUy-0K-UzK" secondAttribute="bottom" constant="12" id="WDE-us-ZdJ"/>
37+
<constraint firstItem="MUy-0K-UzK" firstAttribute="top" secondItem="yNN-dG-kuA" secondAttribute="bottom" constant="16" id="nHE-te-rHP"/>
3138
<constraint firstItem="MUy-0K-UzK" firstAttribute="top" secondItem="vUN-kp-3ea" secondAttribute="top" constant="12" id="nmY-jt-bfb"/>
39+
<constraint firstItem="yNN-dG-kuA" firstAttribute="leading" secondItem="MUy-0K-UzK" secondAttribute="leading" id="wb7-Ze-GOP"/>
3240
</constraints>
3341
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
3442
<connections>
35-
<outlet property="label" destination="MUy-0K-UzK" id="Z0t-WU-7ls"/>
43+
<outlet property="subtitle" destination="yNN-dG-kuA" id="ztZ-PR-aGH"/>
44+
<outlet property="title" destination="MUy-0K-UzK" id="Par-ou-0ia"/>
3645
</connections>
3746
<point key="canvasLocation" x="139" y="109"/>
3847
</view>

0 commit comments

Comments
 (0)