Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ internal class ATHMultiSelectionControlSegmentButton: UIButton {
internal var isButtonEnabled: Bool {
return _isButtonEnabled
}
/// The color of the text when selected
internal var titleColorSelected: UIColor?

override var isHighlighted: Bool {

Expand Down Expand Up @@ -82,9 +84,9 @@ internal class ATHMultiSelectionControlSegmentButton: UIButton {
*/
fileprivate func _setSelectedState() {

layer.borderColor = backgroundColor?.cgColor
layer.borderColor = self.titleColorSelected?.cgColor
backgroundColor = tintColor
setTitleColor(UIColor.white, for: .normal)
setTitleColor(self.titleColorSelected ?? UIColor.white, for: .normal)

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ open class MultiSelectionSegmentedControl: UIView {
button.titleLabel?.font = font
button.tintColor = tintColor
button.backgroundColor = backgroundColor
button.titleColorSelected = backgroundColor
button.setButtonSelected(selectedSegmentIndices.contains(index))
button.addTarget(self, action: #selector(self._didTouchUpInsideSegment(_:)), for: .touchUpInside)

Expand Down Expand Up @@ -325,8 +326,10 @@ open class MultiSelectionSegmentedControl: UIView {

let button = ATHMultiSelectionControlSegmentButton(frame: CGRect(x: self.frame.width, y: 0, width: 0, height: self.frame.height))

button.titleLabel?.font = font
button.tintColor = tintColor
button.backgroundColor = backgroundColor
button.titleColorSelected = backgroundColor
button.addTarget(self, action: #selector(self._didTouchUpInsideSegment(_:)), for: .touchUpInside)

button.setTitle(title, for: .normal)
Expand Down