Skip to content

Commit

Permalink
feat(ListCellContentView): Add public titleTextColorType property to …
Browse files Browse the repository at this point in the history
…be able to change the center section title color.

* IOS-9261 Add public titleTinColor property to be able to change the title text color from the clients.

* Run swiftformat

* IOS-9261 Changed titleTintColor for titleTextColorType to be more explicit and do not support any color.

* Run swiftformat

---------

Co-authored-by: idenjoe <idenjoe@users.noreply.github.com>
  • Loading branch information
idenjoe and idenjoe authored Nov 2, 2023
1 parent 63b7d0b commit d6a2dd9
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Sources/Mistica/Components/Lists/ListCellContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,20 @@ open class ListCellContentView: UIView {
static let cellWidth: CGFloat = 324.0
}

public enum TitleTextColorType {
case normal
case danger

var value: UIColor {
switch self {
case .normal:
return .textPrimary
case .danger:
return .textLinkDanger
}
}
}

@frozen
public enum CellStyle {
case fullWidth
Expand Down Expand Up @@ -84,6 +98,12 @@ open class ListCellContentView: UIView {
}
}

public var titleTextColorType: TitleTextColorType = .normal {
didSet {
centerSection.titleTextColor = titleTextColorType.value
}
}

public var subtitle: String? {
get {
centerSection.subtitleLabel.text
Expand Down

0 comments on commit d6a2dd9

Please sign in to comment.