fixed bug in flipping colors

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2022-12-20 11:49:37 -06:00
parent 10f0d35ff2
commit 76454b2771

View File

@ -59,6 +59,17 @@ open class Tilet: TileContainer {
// MARK: - Public Properties
//--------------------------------------------------
private var titleLockup = TitleLockup()
open override var surface: Surface {
didSet {
//flip the color
let flippedColor:ContainerBackgroundColor = surface == .dark ? .white : .black
containerBackgroundColor = flippedColor
//flip the surface for the titleLockup
let flippedSurface: Surface = surface == .dark ? .light : .dark
titleLockup.surface = flippedSurface
}
}
//--------------------------------------------------
// MARK: - Public Properties
@ -87,6 +98,7 @@ open class Tilet: TileContainer {
open override func setup() {
super.setup()
surface = .light
addContentView(titleLockup)
contentViewWithConstraint = titleLockup.widthAnchor.constraint(equalToConstant: width - (padding * 2))
contentViewWithConstraint?.isActive = true