Skip to content

Commit 664eba1

Browse files
committed
Adjust default track fill color to tertiarySystemFill as suggested by Apple's [documentation](https://developer.apple.com/documentation/uikit/uicolor/ui_element_colors)
This also follows the example of the stock Home app, which appears to use `tertiarySystemFill` (or something with a similar contrast ratio) for the track of similar slider controls
1 parent c03c021 commit 664eba1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

TactileSlider/Classes/TactileSlider.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,12 @@ import UIKit
8686

8787
/// The color of the track the slider slides along
8888
///
89-
/// - Important: This defaults to the dynamic system fill color on iOS 13 or greater, but to lightGray on older versions
89+
/// - Note: By default, this is set to `tertiarySystemFill`, which the [documentation](https://developer.apple.com/documentation/uikit/uicolor/ui_element_colors) specifies is for filling large shapes. Be sure to use an appropriate fill color for the size of the control.
90+
///
91+
/// - Important: On iOS versions prior to iOS 13 that do not support dynamic system colors, this defaults to `lightGray`.
9092
@IBInspectable open var trackBackground: UIColor = {
9193
if #available(iOS 13, *) {
92-
return .systemFill
94+
return .tertiarySystemFill
9395
} else {
9496
return .lightGray
9597
}

0 commit comments

Comments
 (0)