Skip to content

Commit 700d7f2

Browse files
committed
Improve use of tint color
Use tintColor for editable content such as the value in `PSMultiValueSpecifier` or `PSChildPaneSpecifier`. Exception: MultiValue elements in list groups are not tinted to emphasize the "Add" button.
1 parent a6551fd commit 700d7f2

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

InAppSettingsKit.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'InAppSettingsKit'
3-
s.version = '3.8'
3+
s.version = '3.8.1'
44
s.summary = 'This iPhone framework allows settings to be in-app in addition to being in the Settings app.'
55

66
s.description = <<-DESC

Sources/InAppSettingsKit/Controllers/IASKAppSettingsViewController.m

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
609609
}
610610

611611
UITableViewCell* cell = [self tableView:tableView newCellForSpecifier:specifier];
612+
cell.textLabel.textColor = (specifier.isAddSpecifier || specifier.textAlignment == NSTextAlignmentCenter) ? self.tintColor : [UILabel appearanceWhenContainedInInstancesOfClasses:@[UITableViewCell.class]].textColor;
612613
if (![specifier.type isEqualToString:kIASKPSSliderSpecifier]) {
613614
cell.imageView.image = specifier.cellImage;
614615
}
@@ -648,11 +649,16 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
648649

649650
BOOL hasTitle = title.length > 0 && !specifier.isItemSpecifier;
650651
cell.detailTextLabel.text = [[specifier titleForCurrentValue:currentValue ?: specifier.defaultValue] description];
652+
cell.detailTextLabel.textColor = self.tintColor;
651653
if (hasTitle) {
652654
cell.textLabel.text = title;
653655
} else {
654656
cell.textLabel.text = cell.detailTextLabel.text;
655657
cell.detailTextLabel.text = nil;
658+
659+
if (!specifier.parentSpecifier) {
660+
cell.textLabel.textColor = self.tintColor;
661+
}
656662
}
657663
}
658664
else if (specifier.embeddedDatePicker) {
@@ -760,6 +766,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
760766
cell.textLabel.text = [self.settingsReader titleForId:valueString];
761767
} else {
762768
cell.detailTextLabel.text = [self.settingsReader titleForId:valueString];
769+
cell.detailTextLabel.textColor = self.tintColor;
763770
}
764771
}
765772
}
@@ -802,7 +809,6 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
802809
cell.detailTextLabel.textAlignment = specifier.textAlignment;
803810
cell.textLabel.adjustsFontSizeToFitWidth = specifier.adjustsFontSizeToFitWidth;
804811
cell.detailTextLabel.adjustsFontSizeToFitWidth = specifier.adjustsFontSizeToFitWidth;
805-
cell.textLabel.textColor = (specifier.isAddSpecifier || specifier.textAlignment == NSTextAlignmentCenter) ? self.tintColor : [UILabel appearanceWhenContainedInInstancesOfClasses:@[UITableViewCell.class]].textColor;
806812
return cell;
807813
}
808814

0 commit comments

Comments
 (0)